Persistent queue for Python AsyncIO.
Project description
Persistent queue for Python AsyncIO.
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:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aiodiskqueue-0.1.0b8.tar.gz
.
File metadata
- Download URL: aiodiskqueue-0.1.0b8.tar.gz
- Upload date:
- Size: 54.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61475290bd56dcd64c742380366f8d61ff7af0bb2c5013e5f092b08f36e4b62b |
|
MD5 | a4d25fcb24fae48339845aed57937a04 |
|
BLAKE2b-256 | 9597d04dff4966d1409a9a0dcefac926924501153d613db9046b52c15561b3c1 |
File details
Details for the file aiodiskqueue-0.1.0b8-py3-none-any.whl
.
File metadata
- Download URL: aiodiskqueue-0.1.0b8-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af561482f231cb7ad953e0f0f92d16cbc290cf966d746c30b359428c73dd4989 |
|
MD5 | 96c81a26b78b89eabcb356768089819d |
|
BLAKE2b-256 | 5a67cc2441a3e346727c635fbdd5557b7d448e4abc44b9cee14bb48f8c2bd9bf |