-
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
Rewrite of wait_readable to use the Cellulid::ZMQ mailbox reactor #21
Conversation
@CootCraig could you remove the version changes in this commit? |
if actor && actor.mailbox.is_a?(Celluloid::ZMQ::Mailbox) | ||
actor.mailbox.reactor.wait_readable(socket) | ||
else | ||
throw NotZmqActorError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure we should raise here.
@tarcieri ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably just call it a TypeError or ArgumentError
@halorgium I'm removing the version change and yes I'll move #evented? |
On the socket read, only call Celluloid::ZMQ.wait_readable if Celluloid::ZMQ.evented? Set the version back to 0.13.0 Set the celluloid-io dependency back to 0.13.0
Pushed changes to the craig branch on CootCraig/celluloid-zmq Move the evented? function to the module, Celluloid::ZMQ.evented? |
@@ -68,7 +59,7 @@ def connect(addr) | |||
|
|||
# Read a message from the socket | |||
def read(buffer = '') | |||
Celluloid.current_actor.wait_readable(@socket) if evented? | |||
Celluloid::ZMQ.wait_readable(@socket) if Celluloid::ZMQ.evented? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you moved the check inside the method, it would be more closer to celluloid-io.
https://github.com/celluloid/celluloid-io/blob/032a100f46fb1887e12c2faad9f6bfa377cee5e1/lib/celluloid/io/stream.rb#L39
@CootCraig I am not sure the change is being solved in the right way here. Also, I just cleaned up celluloid-io. |
I just got up for the day. Let me know about doing IRC. I'll fetch the latest and have a look now. |
Also my read test case is working on Windows JRuby as well. $ jruby -v |
I have grabbed the spelling change by @halorgium and done a new branch with ZMQ::Socket#read I have kept the evented? guard on the wait in Socket#read. This would prevent an exception if evented? fails |
I have a test script that does Socket#read with Celluloid/zmq. It is working on Ubuntu and Windows $ jruby -v $ jruby -v |
Also I made no changes for Socket#write. |
@CootCraig sorry I missed you on IRC, timezones are hard! |
See #20 |
A change in response to #20