-
Notifications
You must be signed in to change notification settings - Fork 25
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
How to wakeup a protocol? #3
Comments
Well, this is something half-baked. You need to know the token, but I don't want to expose token directly. I want some kind of Future object, that can be used to send the messages. The problem with exposing token is that it is reused very fast in the current Slab implementation. I.e. if you just removed the state machine, you free the token and the next state machine is allocated with this exact token (not the smallest number, but the latest one). So it's hard to use. So yes the feature is not fully designed yet. |
Okay, that's fair enough; I was just wondering if I had missed something. I know this is a work in progress, but I'm quite excited by the project and really want to try hacking some things together to get a feel for it. I'll just have to contain my impatience for now though 😄 Keep up the good work! |
Okay, I've just pushed the "future" branch of "rotor" and "rotor-http". The basic idea is that you do:
The
This sets the value and wakes up the state machine that created the future initially. Port should be thread safe. The
This is very preliminary API. Also, support of this in Any feedback is appreciated. |
Wonderful, thanks for the update! I'll try and have a look over the next week, but the preliminary API looks good. |
Just released a version on crates.io. Hopefully add some docs soon. |
Fab! Thanks :) On Mon, 4 Jan 2016 11:16 Paul Colomiets notifications@github.com wrote:
|
Reading the code it appears that to wake a protocol/event machine/thing up I need to know its associated
mio::Token
, however that doesn't seem to be exposed anywhere. Is this possible to do currently?The text was updated successfully, but these errors were encountered: