Subscribe to Server Sent Events at Scale

I want to create a php script and run it as a shell script to subscribe to Server Side Events and process them. The aim is to have the script keep the connection open and as the events come in they are processed and stored in a db.

Is this the correct way to do it? Or should I be using some other method.

Also, as this grows out the number of devices and events are going to large. Does anyone know of a good resource to guide me through how to separate the collecting of the events from the processing thereof.

Web hooks are a better choice for this scenario. Your script is going to be called when there’s an event to record.

Hi

Thanks. I will investigate that further

Cheers
Michael