Good evening everyone (or good morning if in your timezone it is morning),
I have created an mqtt class that works flawlessly in a JServer app but it must be run in the main thread which locks it if it receives a published message.
I was looking to run the class in a different thread but I cannot figure out how to do this with the Threading library by @agraham. It has a class object but I am not sure how to do it because I do not control the executing of the MessageReceived sub but the Payload sender does. So what should I do in such a case?
Edit - I forgot to mention that it does a time consuming database procedure on mqtt message received.
I have created an mqtt class that works flawlessly in a JServer app but it must be run in the main thread which locks it if it receives a published message.
I was looking to run the class in a different thread but I cannot figure out how to do this with the Threading library by @agraham. It has a class object but I am not sure how to do it because I do not control the executing of the MessageReceived sub but the Payload sender does. So what should I do in such a case?
Edit - I forgot to mention that it does a time consuming database procedure on mqtt message received.