tailhook / rotor-http

The mio/rotor based http server library for rust (UNMAINTAINED, use tk-http)
MIT License
110 stars 11 forks source link

Error Waking up Parser<P, S> FSM #45

Open KodrAus opened 8 years ago

KodrAus commented 8 years ago

I'm absolutely positive I'm doing this wrong; I have a rotor_http::client::Persistent<P, S> machine, which wraps rotor_http::client::Parser<P, S>.

If I use a Notifier to wake up my fsm while a request is active, I get a panic in the Parser and everything blows up. The source of the panic is this line in the Parser wrapper:

https://github.com/tailhook/rotor-http/blob/master/src/client/parser.rs#L576

So if I shouldn't be waking up my fsm while it's already busy, how can I avoid calling wakeup in code that doesn't know what that machine is up to? I would've thought you could just ignore wakeup on a busy machine, because it's already awake?

tailhook commented 8 years ago

Well, the unimplemented always means we have not done this stuff yet. Not that you're doing it wrong.

Since there is wakeup handler in Requester it seems to be easy to fix. Do you want to do a pull request?