Skip to content

v2.10.0

Compare
Choose a tag to compare
@Tochemey Tochemey released this 12 Dec 15:19
· 21 commits to main since this release

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 option
  • WithSupervisor: removed from the SpawnOption

Pull requests

Full Changelog: v2.9.1...v2.10.0