Class: Thrift::MultiplexedProtocol

Inherits:
BaseProtocol
  • Object
show all
Includes:
ProtocolDecorator
Defined in:
lib/thrift/protocol/multiplexed_protocol.rb

Instance Method Summary collapse

Methods included from ProtocolDecorator

#read_binary, #read_bool, #read_byte, #read_double, #read_field_begin, #read_field_end, #read_i16, #read_i32, #read_i64, #read_list_begin, #read_list_end, #read_map_begin, #read_map_end, #read_message_begin, #read_message_end, #read_set_begin, #read_set_end, #read_string, #read_struct_begin, #read_struct_end, #trans, #write_binary, #write_bool, #write_byte, #write_double, #write_field_begin, #write_field_end, #write_field_stop, #write_i16, #write_i32, #write_i64, #write_list_begin, #write_list_end, #write_map_begin, #write_map_end, #write_message_end, #write_set_begin, #write_set_end, #write_string, #write_struct_begin, #write_struct_end

Constructor Details

#initialize(protocol, service_name) ⇒ MultiplexedProtocol

Returns a new instance of MultiplexedProtocol.



8
9
10
11
# File 'lib/thrift/protocol/multiplexed_protocol.rb', line 8

def initialize(protocol, service_name)
  super(protocol)
  @service_name = service_name
end

Instance Method Details

#write_message_begin(name, type, seqid) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/thrift/protocol/multiplexed_protocol.rb', line 13

def write_message_begin(name, type, seqid)
  case type
  when MessageTypes::CALL, MessageTypes::ONEWAY
    @protocol.write_message_begin("#{@service_name}:#{name}", type, seqid)
  else
    @protocol.write_message_begin(name, type, seqid)
  end 
end