tonarino / actor

A minimalist actor framework aiming for high performance and simplicity.
MIT License
40 stars 6 forks source link

Add `priority` field to `SendError`, `DisconnectedError` #64

Closed strohel closed 2 years ago

strohel commented 2 years ago

Move name field from Recipient to internal MessageSender

This is a tiny struct size optimization, because multiple Recipients share a single MessageSender through an Arc.

But more importantly this allows us to implement the next commit (add priority to error types) more cleanly.

Add priority field to SendError, DisconnectedError

This should help with diagnosing actor channel full errors.

Also changes signature of the callback accepted by SendErrorExt::on_full() method, which is a breaking change.

Fix non-determinism in errors() test

Thanks @bschwind for pointing-out zero-capacity flume channels are special.

strohel commented 2 years ago

Would you increment semvar in a separate PR?

I plan to do 2 more small PRs and then cut a new release (semver-incompatible, i.e. 0.8.0) - it seems that cargo-release will bump the version for us judging from the last time.