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

Method task_done

Lib/asyncio/queues.py:219–237  ·  view source on GitHub ↗

Indicate that a formerly enqueued task is complete. Used by queue consumers. For each get() used to fetch a task, a subsequent call to task_done() tells the queue that the processing on the task is complete. If a join() is currently blocking, it will resume when all

(self)

Source from the content-addressed store, hash-verified

217 return item
218
219 def task_done(self):
220 """Indicate that a formerly enqueued task is complete.
221
222 Used by queue consumers. For each get() used to fetch a task,
223 a subsequent call to task_done() tells the queue that the processing
224 on the task is complete.
225
226 If a join() is currently blocking, it will resume when all items have
227 been processed (meaning that a task_done() call was received for every
228 item that had been put() into the queue).
229
230 Raises ValueError if called more times than there were items placed in
231 the queue.
232 """
233 if self._unfinished_tasks <= 0:
234 raise ValueError('task_done() called too many times')
235 self._unfinished_tasks -= 1
236 if self._unfinished_tasks == 0:
237 self._finished.set()
238
239 async def join(self):
240 """Block until all items in the queue have been gotten and processed.

Callers 14

_monitorMethod · 0.45
workerMethod · 0.45
test_queue_task_doneMethod · 0.45
test_queue_joinMethod · 0.45
_read_msg_threadMethod · 0.45
_get_task_doneMethod · 0.45
_shutdown_put_joinMethod · 0.45
_test_task_doneMethod · 0.45
workerMethod · 0.45

Calls 1

setMethod · 0.45

Tested by 13

workerMethod · 0.36
test_queue_task_doneMethod · 0.36
test_queue_joinMethod · 0.36
_read_msg_threadMethod · 0.36
_get_task_doneMethod · 0.36
_shutdown_put_joinMethod · 0.36
_test_task_doneMethod · 0.36
workerMethod · 0.36