Method: Nsq::Consumer#pop_without_blocking
- Defined in:
- lib/nsq/consumer.rb
#pop_without_blocking ⇒ Object
By default, if the internal queue is empty, pop will block until a new message comes in.
Calling this method won’t block. If there are no messages, it just returns nil.
62 63 64 65 66 67 |
# File 'lib/nsq/consumer.rb', line 62 def pop_without_blocking @messages.pop(true) rescue ThreadError # When the Queue is empty calling `Queue#pop(true)` will raise a ThreadError nil end |