Directus / @directus/memory / index / BusLocal
Class: BusLocal
Implements
Constructors
new BusLocal(_config)
new BusLocal(
_config
):BusLocal
Parameters
• _config: Omit
<BusConfigLocal
, "type"
>
Returns
Source
packages/memory/src/bus/lib/local.ts:7
Properties
handlers
private
handlers:Record
<string
,Set
<MessageHandler
<any
>>>
Source
packages/memory/src/bus/lib/local.ts:5
Methods
publish()
publish<
T
>(channel
,payload
):Promise
<void
>
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
Source
packages/memory/src/bus/lib/local.ts:11
subscribe()
subscribe<
T
>(channel
,callback
):Promise
<void
>
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
Source
packages/memory/src/bus/lib/local.ts:24
unsubscribe()
unsubscribe(
channel
,callback
):Promise
<void
>
Unsubscribe from a channel
Parameters
• channel: string
Channel to unsubscribe from
• callback: MessageHandler
Callback to remove from the stack
Returns
Promise
<void
>