Running Cloud Functions in a Seperate Thread

I was read the device os github page and noticed this paragrah:

Is there a way to opt in to running cloud functions in a seperate thread in application firmware? Is there a macro such as SYSTEM_THREAD(ENABLED)?

No, there is not. Cloud functions, variables, and subscription handlers are all called from the loop thread.

If you are worried about your loop thread blocking those, the better option is to move blocking functions out of the loop their into their own worker thread. The most important is to move Particle.publish() to a worker thread. If you use Cellular.RSSI(), that one is also important to not call from loop.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.