A wrapper around Python Paho Mqtt library
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
Drift MQTT tools
A collection of helpers to work with MQTT:
Client
- wrapper aroundpaho.mqtt.Client
that correctly handles subscriptions after reconnect
Usage
Producer
from drift_mqtt import Client
client = Client('tcp://127.0.0.1:8000', 'client_id')
client.connect()
client.loop_start()
...
client.publish('topic', 'some message')
Consumer
from drift_mqtt import Client
def message_handler(message):
print('Got message ', message.payload, message.topic)
client = Client('tcp://127.0.0.1:8000', client_id='test_subscriber')
client.subscribe('test_topic', message_handler)
client.connect()
client.loop_forever()
For more details please check examples/
folder
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file drift_mqtt-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: drift_mqtt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
9a1564b685954ca6c54b147a1585dc15f52cb5670210a2374d48aa74bde0e638
|
|
MD5 |
194978b99dc0566766d427502cefb2c0
|
|
BLAKE2b-256 |
e5f4b03a68365923afbda2534fa60116bea2a2ef3976736d8703a188f0210226
|