Integrate blocking and multiplexing workers usage

This commit is contained in:
Thibault Jouan
2015-04-17 21:25:43 +00:00
parent fa03cd736a
commit 9ea43ee69a
7 changed files with 35 additions and 3 deletions

View File

@@ -77,6 +77,11 @@ module Uh
opts.on '-l', '--layout LAYOUT', 'specify layout' do |layout|
@env.layout_class = self.class.const_get layout.to_sym
end
opts.on '-w', Workers.types, '--worker WORKER',
'specify worker' do |worker|
@env.worker = worker.to_sym
end
end
end
end

View File

@@ -73,7 +73,9 @@ module Uh
end
def run_until &block
manager.handle_pending_events until block.call
worker.watch @manager
@env.log "Working events with `#{worker.class}'"
worker.work_events until block.call
end
def terminate