MCPcopy Index your code
hub / github.com/python/cpython / _getresponse

Method _getresponse

Lib/idlelib/rpc.py:306–326  ·  view source on GitHub ↗
(self, myseq, wait)

Source from the content-addressed store, hash-verified

304 return obj
305
306 def _getresponse(self, myseq, wait):
307 self.debug("_getresponse:myseq:", myseq)
308 if threading.current_thread() is self.sockthread:
309 # this thread does all reading of requests or responses
310 while True:
311 response = self.pollresponse(myseq, wait)
312 if response is not None:
313 return response
314 else:
315 # wait for notification from socket handling thread
316 cvar = self.cvars[myseq]
317 cvar.acquire()
318 while myseq not in self.responses:
319 cvar.wait()
320 response = self.responses[myseq]
321 self.debug("_getresponse:%s: thread woke up: response: %s" %
322 (myseq, response))
323 del self.responses[myseq]
324 del self.cvars[myseq]
325 cvar.release()
326 return response
327
328 def newseq(self):
329 self.nextseq = seq = self.nextseq + 2

Callers 1

getresponseMethod · 0.95

Calls 5

debugMethod · 0.95
pollresponseMethod · 0.95
acquireMethod · 0.45
waitMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected