lib/celluloid/zmq/reactor.rb in celluloid-zmq-0.0.3 vs lib/celluloid/zmq/reactor.rb in celluloid-zmq-0.0.4

- old
+ new

@@ -41,10 +41,15 @@ end # Run the reactor, waiting for events, and calling the given block if # the reactor is awoken by the waker def run_once(timeout = nil) - timeout ||= :blocking + if timeout + timeout *= 1000 # Poller uses millisecond increments + else + timeout = :blocking + end + rc = @poller.poll(timeout) unless ::ZMQ::Util.resultcode_ok? rc raise IOError, "0MQ poll error: #{::ZMQ::Util.error_string}" end