MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / get

Method get

tools/python-3.11.9-amd64/Lib/asyncio/queues.py:149–173  ·  view source on GitHub ↗

Remove and return an item from the queue. If queue is empty, wait until an item is available.

(self)

Source from the content-addressed store, hash-verified

147 self._wakeup_next(self._getters)
148
149 async def get(self):
150 """Remove and return an item from the queue.
151
152 If queue is empty, wait until an item is available.
153 """
154 while self.empty():
155 getter = self._get_loop().create_future()
156 self._getters.append(getter)
157 try:
158 await getter
159 except:
160 getter.cancel() # Just in case getter is not done yet.
161 try:
162 # Clean self._getters from canceled getters.
163 self._getters.remove(getter)
164 except ValueError:
165 # The getter could be removed from self._getters by a
166 # previous put_nowait call.
167 pass
168 if not self.empty() and not getter.cancelled():
169 # We were woken up by put_nowait(), but can't take
170 # the call. Wake up the next in line.
171 self._wakeup_next(self._getters)
172 raise
173 return self.get_nowait()
174
175 def get_nowait(self):
176 """Remove and return an item from the queue.

Callers 13

_readerMethod · 0.95
_readerMethod · 0.95
_is_debug_modeFunction · 0.45
__init__Method · 0.45
__repr__Method · 0.45
_handle_signalMethod · 0.45
add_child_handlerMethod · 0.45
get_extra_infoMethod · 0.45
current_taskFunction · 0.45
_wait_for_oneFunction · 0.45
_enter_taskFunction · 0.45
_leave_taskFunction · 0.45

Calls 9

emptyMethod · 0.95
_wakeup_nextMethod · 0.95
get_nowaitMethod · 0.95
_get_loopMethod · 0.80
create_futureMethod · 0.45
appendMethod · 0.45
cancelMethod · 0.45
removeMethod · 0.45
cancelledMethod · 0.45

Tested by

no test coverage detected