broadcast()
#
Available since 2.9.0
Broadcasts an event and its payload to other cluster nodes.
This function returns once the event has been emitted.
broadcast (event: string, payload: JSONObject): Promise<void>
Argument | Type | Description |
---|---|---|
event | string | Event name |
payload | JSONObject | Event payload |
Usage #
await app.cluster.broadcast('some:event', { payload: 'information' })
Edit this page on Github(opens new window)