Class: Thrift::MultiplexedProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/thrift/multiplexed_processor.rb

Instance Method Summary collapse

Constructor Details

#initializeMultiplexedProcessor

Returns a new instance of MultiplexedProcessor.



5
6
7
# File 'lib/thrift/multiplexed_processor.rb', line 5

def initialize
  @actual_processors = {}
end

Instance Method Details

#process(iprot, oprot) ⇒ Object



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

def process(iprot, oprot)
  name, type, seqid = iprot.read_message_begin
  check_type(type)
  check_separator(name)
  service_name, method = name.split(':')
  processor(service_name).process(StoredMessageProtocol.new(iprot, [method, type, seqid]), oprot)
end

#register_processor(service_name, processor) ⇒ Object



9
10
11
# File 'lib/thrift/multiplexed_processor.rb', line 9

def register_processor(service_name, processor)
  @actual_processors[service_name] = processor
end