Closed romansergey closed 11 years ago
Okay... let me take a look
With the latest checkout I get:
RuntimeError: Cannot use blocks with async yet
I guess this issue now turns into a feature request?
Well, that probably explains part of the source of your problems. We just changed the block semantics so that blocks are called on senders instead of receivers. This probably isn't what you want exactly (there's an option to override it, but it'd be pretty self-defeating in this case)
My suggestion would be to make "fire" actually do what you want, instead of just a placeholder that takes a block.
That said the CancelledKeyException is probably still an issue.
@romansergey the change in block behaviour was designed to stop developers leaking state via blocks.
You can remove the async call and allow Celluloid to proxy the block execution.
If you think about it, you do not want the TestActor
actor to call methods on the request, but instead want it to call the block and have the MyServer
actor execute the block.
My updated gist is https://gist.github.com/halorgium/5404407
Coming from here: https://github.com/tarcieri/nio4r/issues/18 Reproduction: https://gist.github.com/romansergey/5103388
I've tried with the git versions of
celluloid-io
,celluloid
andreel
and it also crashes: