Class: Thrift::MultiplexedProtocol

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

Instance Attribute Summary

Attributes inherited from BaseProtocol

#trans

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

Methods inherited from BaseProtocol

#native?, #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, #read_type, #skip, #write_binary, #write_bool, #write_byte, #write_double, #write_field, #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, #write_type

Constructor Details

#initialize(protocol, service_name) ⇒ MultiplexedProtocol

Returns a new instance of MultiplexedProtocol.



26
27
28
29
# File 'lib/thrift/protocol/multiplexed_protocol.rb', line 26

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

Instance Method Details

#to_sObject



40
41
42
# File 'lib/thrift/protocol/multiplexed_protocol.rb', line 40

def to_s
  "multiplexed(#{@service_name=@protocol.to_s})"
end

#write_message_begin(name, type, seqid) ⇒ Object



31
32
33
34
35
36
37
38
# File 'lib/thrift/protocol/multiplexed_protocol.rb', line 31

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