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>
Argument | Type | Description |
---|---|---|
event | string | Event name |
listener | ClusterEventHandler | Listener function. Called exactly once. |
Usage #
app.cluster.once('some:event', payload => {
// ...listener code...
})
Edit this page on Github (opens new window)