on()
#
Available since 2.9.0
Listens to event emitted with BackendCluster.broadcast.
on (event: string, listener: ClusterEventHandler): Promise<void>
Argument | Type | Description |
---|---|---|
event | string | Event name |
listener | ClusterEventHandler | Listener function. Called as many times as the listened event is received. |
Usage #
app.cluster.on('some:event', payload => {
// ...listener code...
})
Edit this page on Github (opens new window)