-
Notifications
You must be signed in to change notification settings - Fork 44
Passivation
When using cluster sharding, you're still able to explicitly stop an actor. However question here is: what if there are still some messages being pushed to sharded actor's mailbox? In normal condition they would be dead-lettered. To prevent that you may use technique called passivation.
Passivation is action started by sharded actor, which informs its shard, that it's going to stop. In that case after receiving that message, managing shard will start buffer all messages incoming to target actor. Once its dead, if there were some messages waiting on it, actor will be resurrected and messages will be send back to process it.
To trigger passivation, use return Passivate
effect from actor's loop or just call passivate
function at the end of function call.
- Introduction
- Bootstrapping actor system
- Creating an actor
- Static type safety
- Effects
- Managing actor's lifecycle
- Supervision strategies
- Event bus
- Logging
- Socket I/O
- Persistence
- Cluster sharding