Does the Particle.subscribe() event handler interrupt the loop function?

I can’t find the answer to my question, so I’m hoping someone can help me.

My Electron firmware is subscribing to an event that comes from the device cloud. When this event occurs, does the event handler interrupt the currently running code (i.e. can it interrupt the loop function)? Or is the event queued somewhere, and then the event handler is invoked either before or after the loop function?

I’m wondering how careful I need to be about potential conflicts…thanks!!!

Nope, it doesn’t interrupt.
Particle.subscribe() and Particle.function() callback routines are executed in the application context whenever the cloud tasks gain access.
This can be between iterations of loop(), when calling Particle.process() or delay() with an accumulated delay time of 1000ms.

With SYSTEM_THREAD(ENABLED), Software Timers and/or user threads things may get a bit more “complicated” but an incoming even will not interrupt your running code - the FreeRTOS thread scheduler might tho’

Thank you!