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.

Copied to clipboard!
once (event: string, listener: ClusterEventHandler): Promise<void>

Argument Type Description
event
string
Event name
listener
ClusterEventHandler
Listener function. Called exactly once.

Usage #

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