v2.10.0
What's Changed
- Refactor supervisor strategy. See breaking change note.
- Modify testkit method
Send
signature to enforce that testing remains in the probe context by using the actor name instead of the PID - New testkit method
SendSync
to assert Ask-pattern messages has been added. - Actor restart implementation has been refactored. This is the new restart behavior:
- Restart the given actor
- Restart all direct children of the given actor that are alive before the actor is restarted. Grand children are excluded.
- Respect hierarchical relationship between the direct children and the restarted actor in a parent-child relation.
- The restarted actor should be added back to its parent if any.
- Message processing implementation has been refactored to enhance the throughput of number of messages to handle and reduce resource consumption.
- Unbounded priority mailbox added. Performance wise it seems ok for most use cases. Further work may enhance its performance.
BREAKING CHANGE
The main breaking in this release is how the supervisor strategy work now. The developer can easily create mappings between error types and supervisor strategy directives via the NewSupervisorStrategy
method and SpawnOption
. This allows fine-grained error handling during message processing by actor. In that regard the same actor can have one more ways of dealing with error types. Supervisor strategies are defined during the creation of actors. Therefore a faulty actor can be handled differently depending upon the error type. For instance with this new enhancement one can restart
an actor with the following error type &runtime.PanicNilError{}
and the same actor to be stopped on a different error type. More information on the readme.
The following methods are removed:
WithSupervisorDirective
: removed from the actor system optionWithSupervisor
: removed from the SpawnOption
Pull requests
- feat: implement priority mailbox by @Tochemey in #546
- refactor: refactor internal engine by @Tochemey in #548
- fix: fix actor restarting implementation by @Tochemey in #550
- perf: enhance message processing by @Tochemey in #551
- refactor: refactor implementation of supervisor strategy by @Tochemey in #553
- feat: add ask-pattern testing mechanism by @Tochemey in #555
Full Changelog: v2.9.1...v2.10.0