ObjectProtocol allows for easy communication using marshaled ruby objects
module RubyServer include EM::P::ObjectProtocol def receive_object obj send_object({'you said' => obj}) end end
@private
# File lib/em/protocols/object_protocol.rb, line 21 def receive_data data (@buf ||= '') << data while @buf.size >= 4 if @buf.size >= 4+(size=@buf.unpack('N').first) @buf.slice!(0,4) receive_object serializer.load(@buf.slice!(0,size)) else break end end end
Invoked with ruby objects received over the network
# File lib/em/protocols/object_protocol.rb, line 35 def receive_object obj # stub end
Generated with the Darkfish Rdoc Generator 2.