-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support creating differently-typed recipients in Addr::recipient()
...within bounds that that M: Into<N> for Recipient<M> for Actor<Message = N>. Fixes #11 (in its narrow sense) without creating multiple channels per actor and without boxing the messages transferred. Has been made possible by removal of the ability to retrieve back the failed-to-send message in one of the earlier commits. The whole trick is in defining a `Sender<M>` trait to abstract crossbeam::Sender, implementing `<M: Into<N>> Sender<M>` for `crossbeam::Sender<N>`, and boxing *that* implementation in Addr::recipient(). All generic parameters in the echo example have disappeared without losing any flexibility, yay! Speaking strict semver, this is an API-breaking change, but e.g. the media_pipeline compiles and works unchanged. There was a lot of design choices with subtle differences (like making Recipient a trait), this change preferred ones that meant a smaller change.
- Loading branch information
Showing
2 changed files
with
88 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters