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 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 and can be extended with custom 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:

Measurements
  • 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.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiodiskqueue-0.1.1.tar.gz
  • Upload date:
  • Size: 8.9 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.1.tar.gz
Algorithm Hash digest
SHA256 eca63a1cd9ab3127e8564575651fa58be1c0fa63c8c758e99fe3215d6acaf99a
MD5 09cfeb553e0dd9ed2eab20f7d85055dc
BLAKE2b-256 d6782ae40514908d75eb147f0294c72a71a554d1d4bf6190cc0339d7a2df20bf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aiodiskqueue-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 adcd254fd5b946a51c06092661cabecfb47a04fc47bf70e98704222fa2982d91
MD5 e81fc26e0a8600d09bd3f083f7308aeb
BLAKE2b-256 edfb5d59df27b5df79050068b44439782ba18fdc857cd81c38f355e79c1f4342

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