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.0.0.tar.gz (2.6 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.0.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wcpan_queue-7.0.0.tar.gz
  • Upload date:
  • Size: 2.6 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.0.0.tar.gz
Algorithm Hash digest
SHA256 eb93b871e51183c48232f9a9611999ef4d25f1a4b184583564b1665f3a648dc6
MD5 7a177825d8a694c2ba9e7bdf28f43a15
BLAKE2b-256 0c582c72a13e258427f841954e91a490608f93ae6eecac16f7f89bef0456444b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wcpan_queue-7.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7756fc392d6068e12d2dce83980703e720f3de259fb32abbb5d2c2df23cc61db
MD5 4955a056675ec230e6244b5ce3b90666
BLAKE2b-256 eafd35a05d3ddb84e6a4d1da618b769ab36c56d5057e6a530e33593ad5db166b

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