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.



24
25
26
# File 'lib/thrift/multiplexed_processor.rb', line 24

def initialize
  @actual_processors = {}
end

Instance Method Details

#process(iprot, oprot) ⇒ Object



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

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



28
29
30
# File 'lib/thrift/multiplexed_processor.rb', line 28

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