Class: Hokaido::Broadcast::OutputHandler
- Inherits:
-
Object
- Object
- Hokaido::Broadcast::OutputHandler
- Includes:
- Celluloid
- Defined in:
- lib/hokaido/broadcast.rb
Instance Method Summary collapse
-
#initialize(ptyout, connection) ⇒ OutputHandler
constructor
A new instance of OutputHandler.
- #run ⇒ Object
Constructor Details
#initialize(ptyout, connection) ⇒ OutputHandler
Returns a new instance of OutputHandler.
26 27 28 29 30 |
# File 'lib/hokaido/broadcast.rb', line 26 def initialize(ptyout, connection) @ptyout, @connection = ptyout, connection async.run end |
Instance Method Details
#run ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/hokaido/broadcast.rb', line 32 def run while chunk = @ptyout.readpartial(4096) $stdout.write chunk @connection.async.send chunk end rescue EOFError, Errno::EIO # do nothing ensure terminate end |