Skip to main content

Persistent queue for Python AsyncIO.

Project description

Persistent queue for Python AsyncIO.

release python tests codecov docs pre-commit Code style: black

Description

This library provides a persistent FIFO queue for Python AsyncIO:

  • Queue content can persist a process restart

  • Feature parity with Python’s asyncio.Queue

  • Similar API to Python’s asyncio.Queue

  • Sane logging

  • Type hints

  • Fully tested

  • Supports different storage engines

Usage

Here is a basic example on how to use the queue:

import asyncio
from aiodiskqueue import Queue

async def main():
    q = await Queue.create("example_queue.sqlite")
    await q.put("some item")
    item = await q.get()
    print(item)

asyncio.run(main())

Please see the examples folder for more usage examples.

Installation

You can install this library directly from PyPI with the following command:

pip install aiodiskqueue

Logging

The name of the logger for all logging by this library is: aiodiskqueue.

Storage Engines

aiodiskqueue support different storage engines. The default engine is DbmEngine.

We measured the throughput for a typical load scenario (5 producers, 1 consumer) with each storage engine:

chart

  • DbmEngine: Consistent throughput at low and high volumes and about 3 x faster then Sqlite

  • PickledList: Very fast at low volumes, but does not scale well

  • SqliteEngine: Consistent throughput at low and high volumes. Relatively slow.

The scripts for running the measurements and generating this chart can be found in the measurements folder.

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

aiodiskqueue-0.1.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

aiodiskqueue-0.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file aiodiskqueue-0.1.0.tar.gz.

File metadata

  • Download URL: aiodiskqueue-0.1.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for aiodiskqueue-0.1.0.tar.gz
Algorithm Hash digest
SHA256 65229b958cecba979fb73b22c54d95706166d3be447610e18e88e9855968059a
MD5 e8a875372c17f39a3723025d43f329e5
BLAKE2b-256 d3219fa4d18d258480937cb9a1c3f382d920ef0168c9dc1f897470c80dd6704b

See more details on using hashes here.

File details

Details for the file aiodiskqueue-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: aiodiskqueue-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for aiodiskqueue-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a090e8a737837c59464056a708369e99cdb838d8bd9195aff29b88bef3d16c9b
MD5 d7bdc3702aa910aabb7e9e614bafa01b
BLAKE2b-256 45448541128e7edb646ab9cb80bfa62d04cd979fe6d4b5574d846a8cbbb5721c

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