Module: Celluloid::ZMQ
- Defined in:
- lib/celluloid/zmq.rb,
lib/celluloid/zmq/waker.rb,
lib/celluloid/zmq/mailbox.rb,
lib/celluloid/zmq/reactor.rb,
lib/celluloid/zmq/version.rb
Overview
Actors which run alongside 0MQ sockets
Defined Under Namespace
Classes: DeadWakerError, Mailbox, Reactor, Waker
Constant Summary collapse
- VERSION =
"0.0.3"
Class Attribute Summary collapse
-
.context ⇒ Object
Obtain a 0MQ context (or lazily initialize it).
Class Method Summary collapse
-
.included(klass) ⇒ Object
Included hook to pull in Celluloid.
Instance Method Summary collapse
-
#wait_readable(socket) ⇒ Object
Wait for the given IO object to become readable.
-
#wait_writeable(socket) ⇒ Object
Wait for the given IO object to become writeable.
Class Attribute Details
.context ⇒ Object
Obtain a 0MQ context (or lazily initialize it)
22 23 24 |
# File 'lib/celluloid/zmq.rb', line 22 def context @context ||= ::ZMQ::Context.new(1) end |
Class Method Details
Instance Method Details
#wait_readable(socket) ⇒ Object
Wait for the given IO object to become readable
28 29 30 31 |
# File 'lib/celluloid/zmq.rb', line 28 def wait_readable(socket) # Law of demeter be damned! current_actor.mailbox.reactor.wait_readable(socket) end |
#wait_writeable(socket) ⇒ Object
Wait for the given IO object to become writeable
34 35 36 |
# File 'lib/celluloid/zmq.rb', line 34 def wait_writeable(socket) current_actor.mailbox.reactor.wait_writeable(socket) end |