Directus / @directus/memory / index / Bus
Interface: Bus ​
Defined in: packages/memory/src/bus/types/class.ts:3
Methods ​
publish() ​
publish<
T
>(channel
,payload
):Promise
<void
>
Defined in: packages/memory/src/bus/types/class.ts:10
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
>
subscribe() ​
subscribe<
T
>(channel
,callback
):Promise
<void
>
Defined in: packages/memory/src/bus/types/class.ts:18
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
>
unsubscribe() ​
unsubscribe<
T
>(channel
,callback
):Promise
<void
>
Defined in: packages/memory/src/bus/types/class.ts:26
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
>