You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation says that loop_start() can be called either before or after connect(), however this appears not to be true. Calling loop_start() after connect() seems to work fine
The logic I use is to connect than loop. This makes sense to me, in that until you connect successfully looping serves little purpose. I also use connect_async and set a connect=true flag in the on_connect callback, so that I know when it is possible for loop to do any work.
I also call disconnect before loop_stop, since I want to let on_disconnect run. Even un_subscribe gets aborted when you do explicit unscribes and call loop_stop to fast for the broker to respond.
I don't tend to call wait_for_publish the way my code is designed, I use the on_publish call back to let my main loop know a publish was completed based on broker response.
The documentation says that loop_start() can be called either before or after connect(), however this appears not to be true. Calling loop_start() after connect() seems to work fine
but if I call it before
then the message is not published and the wait_for_publish() call hangs.
This behaviour is observed with both version 1.4.0 and 1.5.1
The text was updated successfully, but these errors were encountered: