Integrate blocking and multiplexing workers usage
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user