Class: Upperkut::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/upperkut/processor.rb

Instance Method Summary collapse

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

#killObject



15
16
17
18
# File 'lib/upperkut/processor.rb', line 15

def kill
  return unless @thread
  @thread.raise Upperkut::Shutdown
end

#runObject



9
10
11
12
13
# File 'lib/upperkut/processor.rb', line 9

def run
  @thread ||= Thread.new do
    process
  end
end