Litestar SAQ
[!IMPORTANT] This plugin currently contains minimal features and is a work-in-progress
Installation
pip install litestar-saq
Usage
Here is a basic application that demonstrates how to use the plugin.
from __future__ import annotations
from litestar import Litestar
from litestar_saq import QueueConfig, SAQConfig, SAQPlugin
saq = SAQPlugin(config=SAQConfig(redis_url="redis://localhost:6397/0", queue_configs=[QueueConfig(name="samples")]))
app = Litestar(plugins=[saq])
You can start a background worker with the following command now:
litestar --app-dir=examples/ --app basic:app workers run
Using Litestar app from env: 'basic:app'
Starting SAQ Workers ──────────────────────────────────────────────────────────────────
INFO - 2023-10-04 17:39:03,255 - saq - worker - Worker starting: Queue<redis=Redis<ConnectionPool<Connection<host=localhost,port=6397,db=0>>>, name='samples'>
INFO - 2023-10-04 17:39:06,545 - saq - worker - Worker shutting down
You can also start the process for only specific queues. This is helpful if you want separated processes working on different queues instead of combining them.
litestar --app-dir=examples/ --app basic:app workers run --queues sample
Using Litestar app from env: 'basic:app'
Starting SAQ Workers ──────────────────────────────────────────────────────────────────
INFO - 2023-10-04 17:39:03,255 - saq - worker - Worker starting: Queue<redis=Redis<ConnectionPool<Connection<host=localhost,port=6397,db=0>>>, name='samples'>
INFO - 2023-10-04 17:39:06,545 - saq - worker - Worker shutting down
Metadata
Release files for litestar-saq 0.1.21
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| litestar_saq-0.1.21.tar.gz | 70.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| litestar_saq-0.1.21-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 84.2 kB
Release files / litestar_saq-0.1.21.tar.gz
| Download URL | litestar_saq-0.1.21.tar.gz |
|---|---|
| Size | 70.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2e8121dbc091efb1d7a76f2b7b611a8d178f82da39f2d39143dde08b2210f714
|
|
BLAKE2b-256 checksum How to use checksums |
3210286a83c9b46dcb21d98deeecd771d0f7ce003ef71d847c95d47ef72d05ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / litestar_saq-0.1.21-py3-none-any.whl
| Download URL | litestar_saq-0.1.21-py3-none-any.whl |
|---|---|
| Size | 14.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f30f3efbcbc8d4a2c33b22ea2c79b008f1a0363231194001c7e34e78a50a78ea
|
|
BLAKE2b-256 checksum How to use checksums |
541f41a388beef21026f45a9a4d01a0f683edd6d80671b90d8503ecff629de9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|