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

Method serve

lib/py/src/server/TServer.py:211–230  ·  view source on GitHub ↗

Start a fixed number of worker threads and put client into a queue

(self)

Source from the content-addressed store, hash-verified

209 otrans.close()
210
211 def serve(self):
212 """Start a fixed number of worker threads and put client into a queue"""
213 for i in range(self.threads):
214 try:
215 t = threading.Thread(target=self.serveThread)
216 t.daemon = self.daemon
217 t.start()
218 except Exception as x:
219 logger.exception(x)
220
221 # Pump the socket for clients
222 self.serverTransport.listen()
223 while True:
224 try:
225 client = self.serverTransport.accept()
226 if not client:
227 continue
228 self.clients.put(client)
229 except Exception as x:
230 logger.exception(x)
231
232
233class TForkingServer(TServer):

Callers

nothing calls this directly

Calls 5

startMethod · 0.95
ThreadMethod · 0.80
putMethod · 0.80
acceptMethod · 0.65
listenMethod · 0.45

Tested by

no test coverage detected