Class: Upperkut::Processor
- Inherits:
-
Object
- Object
- Upperkut::Processor
- Defined in:
- lib/upperkut/processor.rb
Instance Method Summary collapse
-
#initialize(manager) ⇒ Processor
constructor
A new instance of Processor.
- #kill ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(manager) ⇒ Processor
Returns a new instance of Processor.
3 4 5 6 7 |
# File 'lib/upperkut/processor.rb', line 3 def initialize(manager) @manager = manager @worker = @manager.worker @sleeping_time = 0 end |
Instance Method Details
#kill ⇒ Object
15 16 17 18 |
# File 'lib/upperkut/processor.rb', line 15 def kill return unless @thread @thread.raise Upperkut::Shutdown end |
#run ⇒ Object
9 10 11 12 13 |
# File 'lib/upperkut/processor.rb', line 9 def run @thread ||= Thread.new do process end end |