-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rtic-sync: DynSender and DynReceiver #62
Comments
Hi, sorry for missing this! I think this is a great idea, a PR world be highly appreciated! |
I'm interested in implementing this feature. |
To clarify I'd also like to work on this, I just was a bit busy last month. @0xf4lc0n we can work together on it if you wish |
Sure, I'm looking forward to cooperating. |
I would like to present my current solution for this problem in rtic-rs/rtic. You can view the whole code in here. I've introduced six new structs and two traits to enhance the functionality:
Additionally, I've introduced two traits:
I've also added tests to ensure the correctness of my implementation. However, there are a couple of challenges I encountered:
Please feel free to review the code and provide feedback or suggestions for improvement. |
I'd like to have dynamically dispatched versions of Sender and Receiver with type erased queue size.
Similar feature is already implemented in embassy_sync.
Motivation
I'm trying to implement an actor model around RTIC. Each actor is supposed to have an address that can be used to send messages to it.
Having the channel's size embedded in the Address type is inconvenient and makes some patterns impossible.
Implementation
Of course, we can't have async functions in traits, but we could work around that by manually implementing
SendFuture
andRecvFuture
types and returning them from regular functions.I'd be happy to write a PR if I get a green light, I may want to ask for some help implementing the futures as I've never done this before.
The text was updated successfully, but these errors were encountered: