Core
Framework v2.x
2

once() #

Available since 2.9.0

Listens to an event emitted with BackendCluster.broadcast.

The registered listener will be called exactly once, after which it will be removed from the listeners list.

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

ArgumentTypeDescription
event
string
Event name
listener
ClusterEventHandler
Listener function. Called exactly once.

Usage #

app.cluster.once('some:event', payload => {
  // ...listener code...
})