I’ve been checking out some of the published extensions client code, and it seems that they’re all polling their EBS every X minutes from all clients, this is seems counter-productive to me. I think a better way would be for the clients to listen to the EBS for updates.
- EBS regularly queries an external API to get the relevant data, persists it if needed.
- When a specific condition is met (new data for example), EBS sends a message to all clients that are listening for that specific channel
Is this not possible? or am I missing something?
Different people do things in different waits that meets their requirements to achieve the needs of their application.
The method you describe might work perfectly fine for your application.
Also note, that every 30 mins or so, Twitch will refresh the Access Key for the user/extension which will generally result in an EBS ping saying “here’s the new key”
I have three extensions published, all three have different client/EBS communication methods, because all three do different things and have different needs.
So “ideal”, there is no “ideal”, design meets what the application and available resources needs.
Don’t want to poll? Use websockets.