Skip to main content

Asynchronous wrapper for paho.mqtt

Project description

apaho: using paho.mqtt with asyncio

  1. Create a paho client
from paho.mqtt.client import Client
cli = Client()
  1. Create a wrapper instance
from apaho import AsyncWrapper
wrapper = AsyncWrapper(cli)
  1. Connect*
await wrapper.connect('localhost')

real asynchronous connect is not working yet, so this call will block

  1. Iterate to get messages
async for message in wrapper:
    logging.error("New message: topic=%r, payload=%r", message.topic, message.payload)

See apaho/demo.py for a complete example.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for apaho, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size apaho-0.1.0.tar.gz (3.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page