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

umqtt.simple: Subscribe and check_msg #256

Open
adebaumann opened this issue Feb 4, 2018 · 4 comments
Open

umqtt.simple: Subscribe and check_msg #256

adebaumann opened this issue Feb 4, 2018 · 4 comments

Comments

@adebaumann
Copy link

Good evening,

Maybe I'm suffering from not seeing the obvious, but how do I use subscriptions asynchronously? As far as I can see in the source code, the "subscribe"-routine ends in an endless "while 1:" loop with a "wait_msg()" inside.
This corresponds with my experience that once I call subscribe(), the rest of my script (except the callback function) is not executed. I've tried the examples too, removing everything after "subscribe(...)" does not seem to make any noticeable difference...

Can somebody help me out here? Maybe I've just been staring at the screen too long...

Cheers!

@zhujisheng
Copy link

you should use check_msg() instead of wait_msg(), if you want unblocked.

@adebaumann
Copy link
Author

Yes, that much is clear. My problem is that "subscribe()" never actually returns because it ends with a "while 1: op = self.wait_msg()..." block.

@EddieParis
Copy link

Your server seems to not reply to the subscription message sent 2 lines above.

Theoretically you have nothing more to do to subscribe to a topic. Check your server logs.

@zhujisheng
Copy link

If the server can't response to the subscribe message correctly, the umqtt client will block.

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