Calling a cloud function on multiple photons

I have two Photon devices, each running identical code and connected to separate LED strips. I'd like to trigger a cloud function on both devices simultaneously, rather than one after the other. Ideally, I want a solution that doesn't require me to modify the triggering code every time I add a new Photon and LED strip setup.

Is there a built-in feature in Particle Cloud that allows me to do this without setting up a separate server or Lambda function to handle the triggering?

An example to try and explain the need for this would be that I have some code somewhere that triggers this function, and I don't want to edit that code every time I add another duplication of this setup (photon + led strip).

There is no way to call two functions simultaneously. However, there is no reason you can't make two simultaneous cloud API calls. They're not guaranteed to occur exactly at the same time, but will be closer than sequentially.

The other option is to use publish and subscribe. Each Photon subscribes to a shared event that specifies the color for all devices that are changing and extracts out the color and pattern intended for that device.

1 Like

You may find this whitepaper helpful: Messaging Architecture for Scale | Scaling | Particle