Impact of Long Processing Time in messageArrived Callback (MQTTAsync) Can It Cause Disconnects? #1630
|
Hi all, I’m using the Eclipse Paho MQTTAsync client in C, and I have a question regarding callback behavior, specifically the messageArrived callback. In my application, the messageArrived callback can sometimes take a long time to process, could even be minutes, depending on the work being performed. I want to confirm whether this can cause any undesired side effects at the MQTT client level. More precisely: Thanks guys, your library is amazing. |
Replies: 1 comment
Yes.
Yes.
Not really; it depends on the requirements for your application, but the general recommendation is: finish as quickly as possible and don't block. In particular, it's ok to initiate another asynchronous MQTT operation from within a callback, but don't block waiting for it to complete. That will result in a deadlock. But also keep in mind the answer to the previous question.
Yes. |
Yes.
Yes.
Not really; it depends on the requirements for your application, but the general recommendation is: finish as quickly as possible and don't block. In particular, it's ok to initiate another asynchronous MQTT operation from within a callback, but don't block waiting for it to complete. That will result in a deadlock.
But also keep in mind the answer to the previous question.