Core
Framework v2.x
2

on() #

Available since 2.9.0

Listens to event emitted with BackendCluster.broadcast.

Copied to clipboard!
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 #

Copied to clipboard!
app.cluster.on('some:event', payload => {
  // ...listener code...
})