Class: MR::PipeTransport::PipeIn

Inherits:
Coolio::IO
  • Object
show all
Includes:
MessageReceiver
Defined in:
lib/pmux/mros.rb

Instance Method Summary collapse

Constructor Details

#initialize(ruby_io, server, pout) ⇒ PipeIn

Returns a new instance of PipeIn.



189
190
191
192
193
194
195
# File 'lib/pmux/mros.rb', line 189

def initialize ruby_io, server, pout
  @ruby_io = ruby_io
  super ruby_io
  @server = server
  @pout = pout
  @pac = MessagePack::Unpacker.new
end

Instance Method Details

#on_closeObject



202
203
204
# File 'lib/pmux/mros.rb', line 202

def on_close
  on_request 0, 'quit', []
end

#on_read(data) ⇒ Object



196
197
198
# File 'lib/pmux/mros.rb', line 196

def on_read data
  @pac.feed_each(data) {|obj| on_message obj}
end

#on_request(msgid, method, param) ⇒ Object



199
200
201
# File 'lib/pmux/mros.rb', line 199

def on_request msgid, method, param
  @server.on_request @pout, msgid, method, param
end