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

Method handle

lib/py/src/server/TServer.py:135–159  ·  view source on GitHub ↗
(self, client)

Source from the content-addressed store, hash-verified

133 logger.exception(x)
134
135 def handle(self, client):
136 itrans = self.inputTransportFactory.getTransport(client)
137 iprot = self.inputProtocolFactory.getProtocol(itrans)
138
139 # for THeaderProtocol, we must use the same protocol instance for input
140 # and output so that the response is in the same dialect that the
141 # server detected the request was in.
142 if isinstance(self.inputProtocolFactory, THeaderProtocolFactory):
143 otrans = None
144 oprot = iprot
145 else:
146 otrans = self.outputTransportFactory.getTransport(client)
147 oprot = self.outputProtocolFactory.getProtocol(otrans)
148
149 try:
150 while True:
151 self.processor.process(iprot, oprot)
152 except TTransport.TTransportException:
153 pass
154 except Exception as x:
155 logger.exception(x)
156
157 itrans.close()
158 if otrans:
159 otrans.close()
160
161
162class TThreadPoolServer(TServer):

Callers 5

acceptMethod · 0.45
acceptMethod · 0.45
runMethod · 0.45
wait_until_listeningFunction · 0.45

Calls 4

getProtocolMethod · 0.65
processMethod · 0.65
closeMethod · 0.65
getTransportMethod · 0.45

Tested by 1

wait_until_listeningFunction · 0.36