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 ​
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 ​
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 ​
Payload that was published to the given channel
Returns ​
Promise
<void
>
Implementation of ​
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 ​
Callback to remove from the stack
Returns ​
Promise
<void
>