lib/localjob/linux_adapter.rb in localjob-0.1.0 vs lib/localjob/linux_adapter.rb in localjob-0.1.1
- old
+ new
@@ -1,7 +1,16 @@
require 'posix/mqueue'
class Localjob
+ class Channel
+ def shift
+ (queue,), = IO.select(@queues)
+ queue.shift
+ rescue POSIX::Mqueue::QueueEmpty
+ retry
+ end
+ end
+
class LinuxAdapter
attr_reader :mqueue
def initialize(name)
@mqueue = POSIX::Mqueue.new(fix_queue_name(name))