Core
Framework v2.x
2

on() #

Available since 2.9.0
Experimental: non-backward compatible changes or removal may occur in any future release.

Listens to event emitted with BackendCluster.broadcast.

Copied to clipboard!
on (event: string, listener: EventHandler): Promise<void>

Argument Type Description
event
string
Event name
listener
EventHandler
Listener function. Called as many times as the listened event is received.

Usage #

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