-
Notifications
You must be signed in to change notification settings - Fork 51
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
Async-with API #69
Comments
@liamdiprose we do not support such behaviour and do not plan to implement it. But implementation of behaviour similar to this one: |
Hi @Lenka42, Thanks for the tips, I might have a go at the context manager class this week. The message = await client.subscribe(...) Asyncio has the Future class, which was made to "bridge low-level callback-based code with high-level async/await code". I'll have a go at wrapping gmqtt's With the global callbacks (#60), the Future implementation probably won't work for more than one subscription at a time. Would you be open to a Pull Request? |
Hi there,
Thanks for sharing this project, I'm very excited to see MQTT and asyncio coming together.
I was surprised by the callback-style API in the basic example. I expected the example to use the async-with pattern like the aiohttp or websockets clients. My recreation:
Do you have any ideas how to implement this? (I'll be looking into it myself)
The text was updated successfully, but these errors were encountered: