class RbbtThreadQueue::RbbtThreadQueueWorker
Public Class Methods
Source
# File lib/rbbt/util/concurrency/threads.rb, line 5 def initialize(queue, mutex = nil, &block) if mutex.nil? super(Thread.current) do |parent| begin loop do p = queue.pop block.call *p end rescue Exception raise $! end end else super(Thread.current) do |parent| begin loop do p = queue.pop p = Array === p ? p << mutex : [p,mutex] block.call *p end rescue Exception raise $! end end end end
Calls superclass method
Public Instance Methods
Source
# File lib/rbbt/util/concurrency/threads.rb, line 32 def clean raise Aborted if alive? end