Skip to main content

aioworkers plugin integration to mqtt

Project description

https://img.shields.io/pypi/v/aioworkers-mqtt.svg https://github.com/aioworkers/aioworkers-mqtt/workflows/Tests/badge.svg Code style: ruff Code style: Mypy Documentation Status Python versions https://img.shields.io/pypi/dm/aioworkers-mqtt.svg Hatch project

Features

  • Queue over mqtt

  • Storage over mqtt

Install

Use uv to add to your project (recommend):

uv add aioworkers-mqtt[paho]

or install with pip:

pip install aioworkers-mqtt[paho]

Usage

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/device

You 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 debug

Development

Check code:

hatch run lint:all

Format code:

hatch run lint:fmt

Run tests:

hatch run pytest

Run tests with coverage:

hatch run cov

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

aioworkers_mqtt-0.1.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aioworkers_mqtt-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file aioworkers_mqtt-0.1.0.tar.gz.

File metadata

  • Download URL: aioworkers_mqtt-0.1.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for aioworkers_mqtt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 31810cd8105ad7b9cc02b92baf69e85493aed94530df99f40aee3b3044970b93
MD5 3856005d7e17f9beadfd80c38ddbfb21
BLAKE2b-256 b2840311894c3a5937cf614ba16f45c377c9e8d5b2ebee67d1e4563cbd3276fa

See more details on using hashes here.

File details

Details for the file aioworkers_mqtt-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aioworkers_mqtt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f9a8ebaa3ea110480b94495e897e97e7b364ab37808a7fb1ddb626b8a0b4059
MD5 0b060eba92f981f92db474aebcab873a
BLAKE2b-256 a7e6c38191839c795e8e5ab8d167d12d623835693666cb24c2812d50bf2117fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page