Skip to content
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

Open
bkanuka opened this issue Dec 3, 2019 · 3 comments
Open

Use external event loop #5

bkanuka opened this issue Dec 3, 2019 · 3 comments

Comments

@bkanuka
Copy link

bkanuka commented Dec 3, 2019

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.

@frederikaalund
Copy link

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

@bkanuka
Copy link
Author

bkanuka commented Apr 6, 2020

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

@mossblaser
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants