Skip to content
On this page

Directus Cloud

Everything you need to start building. Provisioned in 90 seconds. Starting at $15/month.

Get Started

This is an auto-generated document to support extension builders understand the internal packages they can utilize. To find our written guides, tutorials, and API/SDK reference, check out our main docs .

Directus / @directus/memory / index / BusLocal

Class: BusLocal ​

Defined in: packages/memory/src/bus/lib/local.ts:4

Implements ​

Constructors ​

new BusLocal() ​

new BusLocal(_config): BusLocal

Defined in: packages/memory/src/bus/lib/local.ts:7

Parameters ​

_config ​

Omit<BusConfigLocal, "type">

Returns ​

BusLocal

Methods ​

publish() ​

publish<T>(channel, payload): Promise<void>

Defined in: packages/memory/src/bus/lib/local.ts:11

Publish a message to subscribed clients in the given channel

Type Parameters ​

• T = unknown

Parameters ​

channel ​

string

Channel to publish to

payload ​

T

Value to send to the subscribed clients

Returns ​

Promise<void>

Implementation of ​

Bus.publish


subscribe() ​

subscribe<T>(channel, callback): Promise<void>

Defined in: packages/memory/src/bus/lib/local.ts:24

Subscribe to messages in the given channel

Type Parameters ​

• T = unknown

Parameters ​

channel ​

string

Channel to subscribe to

callback ​

MessageHandler<T>

Payload that was published to the given channel

Returns ​

Promise<void>

Implementation of ​

Bus.subscribe


unsubscribe() ​

unsubscribe<T>(channel, callback): Promise<void>

Defined in: packages/memory/src/bus/lib/local.ts:32

Unsubscribe from a channel

Type Parameters ​

• T = unknown

Parameters ​

channel ​

string

Channel to unsubscribe from

callback ​

MessageHandler<T>

Callback to remove from the stack

Returns ​

Promise<void>

Implementation of ​

Bus.unsubscribe