What happens when particle.subscribe event is received by device? When does the subscription handle execute?

Hi all,

I’ve got my electron set up to subscribe to some events and I’m trying to debug some issues.

I’m using SerialLogHandler logHandler(LOG_LEVEL_ALL) to try and figure out when subscribed events are received and then when my handle function is called.

I’m not sure how to interpret the logs and I’d love some more specific info about how subscriptions work and when they’re received?

I’m also sleeping with SLEEP_NETWORK_STANDBY for short periods (< 30 seconds) quite often for context.

Thank you!

Subscriptions will not be services while the device is asleep.
While your code is running events are caught in the background and serviced one-by-one per Particle.process() call - explicit or implicit (between iterations of loop() or every 1000 accumulated milliseconds of delay() time).

Ok cool, thank you for the reply!
Is there anyway to run a loop that checks whether there are any further events that need to be serviced by Particle.process()?
Also is there a reference for this in the docs (just for future use)?

Not that I know of, but when you spin a tight loop just before entering sleep mode you can be as sure as can be that nothing should be left unserviced.

I don't think so.

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