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

Method get

Lib/multiprocessing/queues.py:96–120  ·  view source on GitHub ↗
(self, block=True, timeout=None)

Source from the content-addressed store, hash-verified

94 self._notempty.notify()
95
96 def get(self, block=True, timeout=None):
97 if self._closed:
98 raise ValueError(f"Queue {self!r} is closed")
99 if block and timeout is None:
100 with self._rlock:
101 res = self._recv_bytes()
102 self._sem.release()
103 else:
104 if block:
105 deadline = time.monotonic() + timeout
106 if not self._rlock.acquire(block, timeout):
107 raise Empty
108 try:
109 if block:
110 timeout = deadline - time.monotonic()
111 if not self._poll(timeout):
112 raise Empty
113 elif not self._poll():
114 raise Empty
115 res = self._recv_bytes()
116 self._sem.release()
117 finally:
118 self._rlock.release()
119 # unserialize the data after having released the lock
120 return _ForkingPickler.loads(res)
121
122 def qsize(self):
123 # Raises NotImplementedError on Mac OSX because of broken sem_getvalue()

Callers 12

get_nowaitMethod · 0.95
reducerMethod · 0.45
_decode_messageFunction · 0.45
mainFunction · 0.45
RawValueFunction · 0.45
RawArrayFunction · 0.45
get_temp_dirFunction · 0.45
_run_finalizersFunction · 0.45
startMethod · 0.45
daemonMethod · 0.45
__repr__Method · 0.45
acceptMethod · 0.45

Calls 5

_recv_bytesMethod · 0.45
releaseMethod · 0.45
acquireMethod · 0.45
_pollMethod · 0.45
loadsMethod · 0.45

Tested by

no test coverage detected