Added support for subscribing and listening to topics into 2 separate function calls using a background loop thread.
Instead of being able to only subscribe and listen using 1 call, it is now possible to subscribe and later on use multiple listens to poll for messages. This enables subscribing at the start of a test, trigger a publish and afterwards listen to the topic. At the end of the test, an unsubscribe is recommended when using this method to stop the background thread (also happens on disconnect).
The original subscribe (+ listen) functionality is still present and works in exactly the same way. To use the new method (separate subscribe and listen), set the timeout in the subscribe call to 0 (default).
Added support for subscribing and listening to topics into 2 separate function calls using a background loop thread.
Instead of being able to only subscribe and listen using 1 call, it is now possible to subscribe and later on use multiple listens to poll for messages. This enables subscribing at the start of a test, trigger a publish and afterwards listen to the topic. At the end of the test, an unsubscribe is recommended when using this method to stop the background thread (also happens on disconnect).
The original subscribe (+ listen) functionality is still present and works in exactly the same way. To use the new method (separate subscribe and listen), set the timeout in the subscribe call to 0 (default).
This is also a solution to issue #6