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

Uploaded Source

Built Distribution

aiodiskqueue-0.1.2-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiodiskqueue-0.1.2.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.14

File hashes

Hashes for aiodiskqueue-0.1.2.tar.gz
Algorithm Hash digest
SHA256 642de32fc92937693a3b65d833d34e03d5fe17d14344f53f7b48173290dde665
MD5 571f067e3ad0d7760e700ad2ad4f42d2
BLAKE2b-256 718eabdb862425ba43a083829409d95ccc0c18840f2670bb929e68a0345b0d21

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aiodiskqueue-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.14

File hashes

Hashes for aiodiskqueue-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a7493b5f911af4f3a2e28f0a88a599b3a7db319e8e70493b431a1bd9945eae20
MD5 f6da5dce22625295580b47309d9db34c
BLAKE2b-256 1ee26abc96f0e5a7153c894fee6fdc050487341f81b797e593245506cb618bc2

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