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.
This method can only be used once the application is started.
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' })