MCPcopy Create free account
hub / github.com/apache/thrift / process

Method process

lib/py/src/TMultiplexedProcessor.py:46–74  ·  view source on GitHub ↗
(self, iprot, oprot)

Source from the content-addressed store, hash-verified

44 self.services[key].on_message_begin(func)
45
46 def process(self, iprot, oprot):
47 (name, type, seqid) = iprot.readMessageBegin()
48 if type != TMessageType.CALL and type != TMessageType.ONEWAY:
49 raise TProtocolException(
50 TProtocolException.NOT_IMPLEMENTED,
51 "TMultiplexedProtocol only supports CALL & ONEWAY")
52
53 index = name.find(TMultiplexedProtocol.SEPARATOR)
54 if index < 0:
55 if self.defaultProcessor:
56 return self.defaultProcessor.process(
57 StoredMessageProtocol(iprot, (name, type, seqid)), oprot)
58 else:
59 raise TProtocolException(
60 TProtocolException.NOT_IMPLEMENTED,
61 "Service name not found in message name: " + name + ". " +
62 "Did you forget to use TMultiplexedProtocol in your client?")
63
64 serviceName = name[0:index]
65 call = name[index + len(TMultiplexedProtocol.SEPARATOR):]
66 if serviceName not in self.services:
67 raise TProtocolException(
68 TProtocolException.NOT_IMPLEMENTED,
69 "Service name not found: " + serviceName + ". " +
70 "Did you forget to call registerProcessor()?")
71
72 standardMessage = (call, type, seqid)
73 return self.services[serviceName].process(
74 StoredMessageProtocol(iprot, standardMessage), oprot)
75
76
77class StoredMessageProtocol(TProtocolDecorator.TProtocolDecorator):

Callers

nothing calls this directly

Calls 5

TProtocolExceptionClass · 0.90
findMethod · 0.80
readMessageBeginMethod · 0.65
processMethod · 0.65

Tested by

no test coverage detected