Events Stream
To receive some system events and act on them for some particular business cases, you just need to call the actor system Subscribe
. Make sure to Unsubscribe
whenever the subscription is no longer needed to free allocated resources. The subscription methods can be found on the ActorSystem
interface.
Supported events
ActorStarted
: emitted when an actor has startedActorStopped
: emitted when an actor has stoppedActorPassivated
: emitted when an actor is passivatedActorChildCreated
: emitted when a child actor is createdActorRestarted
: emitted when an actor has restartedActorSuspended
: emitted when an actor has been suspendedNodeJoined
: cluster event emitted when a node joins the cluster. This only happens when cluster mode is enabledNodeLeft
: cluster event emitted when a node leaves the cluster. This only happens when cluster mode is enabledDeadletter
: emitted when a message cannot be delivered or that were not handled by a given actor. Dead letters are automatically emitted when a message cannot be delivered to actors' mailbox or when an Ask times out. Also, one can emit dead letters from the receiving actor by using thectx.Unhandled()
method. This is useful instead of panicking when the receiving actor does not know how to handle a particular message. Dead letters are not propagated over the network, there are tied to the local actor system.
Note
Events that are not handled will be dropped because there is no persistence layer or a replay mechanism. There are processed as they come into the stream.
Last updated