FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [View Raw Code]   [Original HTTPS Page]

cpython/Doc/library/asyncio-queue.rst at 3.5 · python/cpython · GitHub

Repository navigation

Latest commit

 

History

History
158 lines (94 loc) · 4.18 KB
  1. cpython
  2. Doc
  3. library

asyncio-queue.rst

File metadata and controls

158 lines (94 loc) · 4.18 KB
.. currentmodule:: asyncio

Queues

Queues:

  • :class:`Queue`
  • :class:`PriorityQueue`
  • :class:`LifoQueue`

asyncio queue API was designed to be close to classes of the :mod:`queue` module (:class:`~queue.Queue`, :class:`~queue.PriorityQueue`, :class:`~queue.LifoQueue`), but it has no timeout parameter. The :func:`asyncio.wait_for` function can be used to cancel a task after a timeout.

Queue

PriorityQueue

A subclass of :class:`Queue`; retrieves entries in priority order (lowest first).

Entries are typically tuples of the form: (priority number, data).

LifoQueue

A subclass of :class:`Queue` that retrieves most recently added entries first.

Exceptions

.. exception:: QueueEmpty

   Exception raised when the :meth:`~Queue.get_nowait` method is called on a
   :class:`Queue` object which is empty.


.. exception:: QueueFull

   Exception raised when the :meth:`~Queue.put_nowait` method is called on a
   :class:`Queue` object which is full.

Back | FazBrowse Home | New Git URL