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
blocking call in Subscribe() callback #427
Comments
Hi @sahib, The lack of a The first call is for when the The second one is used when messages need to be processed in order ( As you say blocking unnecessarily in any of the call backs is a bad idea (and I include calling Matt |
Thank you @MattBrittan for the quick clarification. Easiest fix for me is then to set
May I suggest to leave a note (e.g. in the docs for the |
You may (it's something I have been meaning to do for some time) but please do feel free to submit a pull request yourself (might happen more quickly than waiting for me!). |
Sure 😄 I was more afraid that my wording skills are not that good, but I tried: #428 |
This is more of a question, than an bug report.
This line here looks like someone forgot a
go
:https://github.com/eclipse/paho.mqtt.golang/blob/master/router.go#L171
On this line the message is handled in a separate go routine:
https://github.com/eclipse/paho.mqtt.golang/blob/master/router.go#L147
I noticed this since I had a (by accident) blocking call in a message handler callback. This apparently caused other message handlers to be not called until the blocking call finished. I realize that blocking in a message handler is not the best idea anyways and might be even expected when
SetOrderMatter(true)
(the default). So the fix is maybe just to remove the weirdfunc() {}
closure around in L171.I use paho.mqtt v1.2.0 together with mosquitto version 1.6.9.
The text was updated successfully, but these errors were encountered: