Sha256: ef061083d234d67e8e56df60753b4a5b63dfb2604be8b555f05ba5cdf4d42581
Contents?: true
Size: 943 Bytes
Versions: 2
Compression:
Stored size: 943 Bytes
Contents
require 'ffi-rzmq' require 'celluloid/io' require 'celluloid/zmq/mailbox' require 'celluloid/zmq/reactor' require 'celluloid/zmq/version' require 'celluloid/zmq/waker' module Celluloid # Actors which run alongside 0MQ sockets module ZMQ class << self attr_writer :context # Included hook to pull in Celluloid def included(klass) klass.send :include, ::Celluloid klass.use_mailbox Celluloid::ZMQ::Mailbox end # Obtain a 0MQ context (or lazily initialize it) def context @context ||= ::ZMQ::Context.new(1) end end # Wait for the given IO object to become readable def wait_readable(socket) # Law of demeter be damned! current_actor.mailbox.reactor.wait_readable(socket) end # Wait for the given IO object to become writeable def wait_writeable(socket) current_actor.mailbox.reactor.wait_writeable(socket) end end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
dcell-0.7.1 | celluloid-zmq/lib/celluloid/zmq.rb |
celluloid-zmq-0.7.0 | lib/celluloid/zmq.rb |