Class: Uh::WM::Workers::Mux
Constant Summary collapse
- TIMEOUT_DEFAULT =
1
Constants inherited from Base
Instance Method Summary collapse
-
#initialize(timeout: TIMEOUT_DEFAULT) ⇒ Mux
constructor
A new instance of Mux.
- #work_events ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(timeout: TIMEOUT_DEFAULT) ⇒ Mux
Returns a new instance of Mux.
7 8 9 10 |
# File 'lib/uh/wm/workers/mux.rb', line 7 def initialize timeout: TIMEOUT_DEFAULT super @timeout = timeout end |
Instance Method Details
#work_events ⇒ Object
12 13 14 15 16 |
# File 'lib/uh/wm/workers/mux.rb', line 12 def work_events @before_watch.call if @before_watch if res = select(@ios, [], [], @timeout) then @on_read.call res else @on_timeout.call if @on_timeout end end |