Skip to main content

An utility for asyncio.Queue.

Project description

wcpan.queue

An utility for asyncio.Queue.

from wcpan.queue import AioQueue


async def task(): ...


async def amain():
    # Creates a priority queue.
    # Use AioQueue.fifo() for FIFO and AioQueue.lifo() for LIFO.
    with AioQueue.priority() as queue:
        # Push a task which priority is 1, lesser number has higher priority.
        # Default is 0.
        # Priority is ignored for FIFO and LIFO queues.
        await queue.push(task(), 1)
        # Spawns 8 consumers to consume the queue.
        # Default is 1.
        await queue.consume(8)

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

wcpan_queue-7.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wcpan_queue-7.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file wcpan_queue-7.1.0.tar.gz.

File metadata

  • Download URL: wcpan_queue-7.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.9.2 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for wcpan_queue-7.1.0.tar.gz
Algorithm Hash digest
SHA256 ab0295b165fbfef35770bbc143026e87f3782f97fd5be252e0c402cf6a8eb4ad
MD5 913d151ce50e08b01ebc3e09bf594973
BLAKE2b-256 abb98fcd3ad98b5e7a3f4c267302c3f1f27c2aacdae2dac579736c8aab08fa67

See more details on using hashes here.

File details

Details for the file wcpan_queue-7.1.0-py3-none-any.whl.

File metadata

  • Download URL: wcpan_queue-7.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.9.2 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for wcpan_queue-7.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75931725e078ca5d1edb0e5b37fef612f429dc3e01459847086a02f7b3adb481
MD5 2a15d842b87642a1e2e9525eb4d5fec0
BLAKE2b-256 e175982743dfaf8473b52e6ad5dddc414f1333680a53c3385b3fe7d6dabdee23

See more details on using hashes here.

Supported by

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