Is AWS IOT SDK V2 Is thread safe #599
-
Hi Team, I am trying to implement the publish function as below. Question is that is the
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes it is thread-safe. Beyond that, a dedicated thread per publish might be overkill, but it's your choice. Note that your implementation can easily accidentally publish the same message many times since the future timeout has no affect on the mqtt client's attempt to deliver the message. The returned future is just a one-way signal from the client to the user. |
Beta Was this translation helpful? Give feedback.
Yes it is thread-safe. Beyond that, a dedicated thread per publish might be overkill, but it's your choice. Note that your implementation can easily accidentally publish the same message many times since the future timeout has no affect on the mqtt client's attempt to deliver the message. The returned future is just a one-way signal from the client to the user.