Skip to main content

Backport python 3.13 asyncio Queue with shutdown.

Project description

backports.asyncio.queues: Backport of the standard library module asyncio.queues

Python 3.13 adds a shutdown method to asyncio.queue.Queue. This package ports the feature to Python 3.9 through 3.12.

Consult the 3.13 specific documentation on Queue for usage.

Installation and depending on this library

This module is called backports.asyncio.queues on PyPI. To install it in your local environment, use:

pip install backports.asyncio.queues

Use

The backports.asyncio.queues module should be a drop-in replacement for the Python 3.13 standard library module asyncio.queue. If you do not support anything earlier than Python 3.13, you do not need this library; you may want to use this idiom to "fall back" to backports.asyncio.queues:

try:
    from asyncio.queues import Queue, QueueShutDown
except ImportError:
    from backports.asyncio.queues import Queue, QueueShutDown

You must import QueueShutDown in order for this pattern to work, as it doesn't exist on Python 3.12 and earlier.

Alternatively, you can use sys.version_info explicitly:

import sys

if sys.version_info >= (3, 13):
    from asyncio.queues import Queue
else:
    from backports.asyncio.queues import Queue

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

backports_asyncio_queues-0.1.2.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

backports_asyncio_queues-0.1.2-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file backports_asyncio_queues-0.1.2.tar.gz.

File metadata

File hashes

Hashes for backports_asyncio_queues-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0a742d7c0299de29b6ee5c2a11ef0851a93caf4ae82bcb1ab3989c30f20e7623
MD5 881c4e9148bdbc31066cb6aa0f7f0666
BLAKE2b-256 186c8070b0e6a2de4f01110e0b0d876f796c164f00651f996a6668883afa3b27

See more details on using hashes here.

File details

Details for the file backports_asyncio_queues-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for backports_asyncio_queues-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d5784876bad9b2923a1c5ad3e7c849c6f13269f0e5668c4d2cdae61aae38dda5
MD5 69bfaca721bffe432f4ffeed1a48c067
BLAKE2b-256 8de6a962474fac3161ae8a255f949dfa3e10e42981b7377933d5d3db02de7810

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page