Core
Framework v2.x
2

on() #

Available since 2.9.0

Listens to event emitted with BackendCluster.broadcast.

on (event: string, listener: ClusterEventHandler): Promise<void>

ArgumentTypeDescription
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...
})