Class: Yunhe::Consumer
- Inherits:
-
Thread
- Object
- Thread
- Yunhe::Consumer
- Defined in:
- lib/yunhe/consumer.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#queue ⇒ Object
Returns the value of attribute queue.
Instance Method Summary collapse
-
#initialize(queue, block) ⇒ Consumer
constructor
Initialize a new consumer queue: the reference of the buffer queue block: the task to process the resource.
Constructor Details
#initialize(queue, block) ⇒ Consumer
Initialize a new consumer queue: the reference of the buffer queue block: the task to process the resource
10 11 12 13 14 |
# File 'lib/yunhe/consumer.rb', line 10 def initialize(queue, block) super &(method(:job).to_proc) @block = block self.queue = queue end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
4 5 6 |
# File 'lib/yunhe/consumer.rb', line 4 def block @block end |
#queue ⇒ Object
Returns the value of attribute queue.
3 4 5 |
# File 'lib/yunhe/consumer.rb', line 3 def queue @queue end |