riker-rs / riker

Easily build efficient, highly concurrent and resilient applications. An Actor Framework for Rust.
https://riker.rs
MIT License
1.02k stars 69 forks source link

[Discussion] notify Subscribe/Unsubscribe subscriber when subscription is actually added #77

Open aav opened 4 years ago

aav commented 4 years ago

Maybe it makes sense to inform channel subscriber, that subscription has been added to the subscription list?

Such notification can be useful in the case when subscriber has to be sure that it will be notified on something, it immediately initiated. This will help to avoid race conditions similar to what currently happens in ActorSystem::shutdown. I believe that this is quite a common pattern.

leenozara commented 4 years ago

@aav Yes, absolutely. This is a common pattern and should be implemented.

(Sorry for the very delayed response. See #82)