-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use external event loop #5
Comments
You may want to have a look at asyncio-mqtt: https://github.com/sbtinstruments/asyncio-mqtt It wraps paho-mqtt in an idiomatic asyncio-based interface. Underneath, it uses the mechanisms described eclipse-paho/paho.mqtt.python/issues/72. Full disclosure: I'm the author of asyncio-mqtt |
Good stuff! I wrote a similar library for trio (not vanilla async like you did) but forgot to "advertise" it. Here's mine: https://github.com/bkanuka/trio-paho-mqtt |
Hello all, sorry I've not got back to any of you about using the event loop properly and for your very helpful references. (A combination of having children and the pandemic have been a bit of a hindrance!) Given the existence of these very nice asyncio MQTT libraries, it seems to me the best thing to do is recommend passers by towards asyncio-mqtt (cracking job, @frederikaalund -- this is the library I'd have wished I'd had when I cobbled this one together!). Whilst I intend to keep this library alive at least (some things I use depend on it) the current inelegance of its construction is not a big enough motivator to change things for now so I'll leave this issue here to track that fact. |
Some changes have been made to Paho MQTT to (actually) allow the use of an external event loop. See Issue 72 - which I beleive actually references this project. It may also be helpful to see the example usage of asyncio.
The text was updated successfully, but these errors were encountered: