Class: Yunhe::Producer

Inherits:
Thread
  • Object
show all
Defined in:
lib/yunhe/producer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(queue, block) ⇒ Producer

Returns a new instance of Producer.



6
7
8
9
10
# File 'lib/yunhe/producer.rb', line 6

def initialize(queue, block)
  super &(method(:job).to_proc)
  @block = block
  self.queue = queue
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



4
5
6
# File 'lib/yunhe/producer.rb', line 4

def block
  @block
end

#queueObject

Returns the value of attribute queue.



3
4
5
# File 'lib/yunhe/producer.rb', line 3

def queue
  @queue
end