dstm
A simple task queue library compatible with AWS SQS or AMQP.
I'm writing dstm because I've been experiencing problems with celery. Celery is big and
complicated, and has many great features that I don't need; which makes tracking down
problems difficult. I just need something that does the absolute basics reliably. That's
what dstm is designed to be.
Quick Start
Define a task in any python module, e.g. in myapp.tasks.email:
from dstm import task
@task(queue="high-priority")
def send_email(recipient: str, content: str):
...
Submit an instance of the task to a message broker:
from dstm import TaskBroker
from dstm.client.sqs import SQSClient
from myapp.tasks.email import send_email
broker = TaskBroker(
SQSClient(boto3.client("sqs")),
queue_prefix="myapp-",
)
broker.submit(send_email, "linus@example.com", "Hi tehre")
Run a worker that executes tasks from the broker:
from dstm import TaskBroker
from dstm.client.sqs import SQSClient
broker = TaskBroker(
SQSClient(boto3.client("sqs")),
queue_prefix="myapp-",
)
broker.run_worker(queues=["high-priority"])
Or using the CLI:
python3 -m dstm worker \
--broker-uri "sqs://" \
--queue-prefix "myapp-" \
--queues "high-priority"
Release files for dstm 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dstm-0.1.6.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dstm-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.4 kB
Release files / dstm-0.1.6.tar.gz
| Download URL | dstm-0.1.6.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7dca56de12e6d42441b728dd71d06312b30493144cf0293dc9ed6d9e7db36012
|
|
BLAKE2b-256 checksum How to use checksums |
cec021ccf44ad09e42fb78633ffab20e78058acc94e63a7c37f4f926dc52486f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.19
|
Release files / dstm-0.1.6-py3-none-any.whl
| Download URL | dstm-0.1.6-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed6af729da8d03a01308f0195c8a100f847870d25179fe4ffd7ef43c22d670d9
|
|
BLAKE2b-256 checksum How to use checksums |
3599c212a51c5683991fe71fd0cf36b5b351d538bb3566cc604ef5b1010ed1f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.19
|