Class: Uh::WM::Workers::KQueue

Inherits:
Base
  • Object
show all
Defined in:
lib/uh/wm/workers/kqueue.rb

Constant Summary collapse

TIMEOUT_DEFAULT =
1

Constants inherited from Base

Base::CALLBACKS

Instance Method Summary collapse

Methods inherited from Base

#watch

Constructor Details

#initialize(timeout: TIMEOUT_DEFAULT) ⇒ KQueue

Returns a new instance of KQueue.



9
10
11
12
# File 'lib/uh/wm/workers/kqueue.rb', line 9

def initialize timeout: TIMEOUT_DEFAULT
  super
  @timeout = timeout * 1000
end

Instance Method Details

#work_eventsObject



14
15
16
17
# File 'lib/uh/wm/workers/kqueue.rb', line 14

def work_events
  @before_watch.call if @before_watch
  queue.run
end