- Queue over mqtt
- Storage over mqtt
Use uv to add to your project (recommend):
uv add aioworkers-mqtt[paho]or install with pip:
pip install aioworkers-mqtt[paho]Add this to aioworkers config.yaml:
queue:
cls: aioworkers_mqtt.Queue
host: localhost
port: 1883
user: user
password: ***
qos: 1
format: json
topics:
- a
- b
storage:
cls: aioworkers_mqtt.Storage
host: localhost
port: 1883
user: user
password: ***
qos: 1
retain: true
format: json
prefix: room/deviceYou can work with queue like this:
await context.queue.put({"a": 1})
d = await context.queue.get()and work with storage like this:
await context.storage.set("a", 1)
one = await context.storage.get("a")Run:
aioworkers -c config.yaml -l debugCheck code:
hatch run lint:allFormat code:
hatch run lint:fmtRun tests:
hatch run pytestRun tests with coverage:
hatch run cov