Econnect API implements a long-polling in /api/updates endpoint. This change leverages this API to understand when the state is updated, so that it can trigger a client.check() call to get the latest. It prevents making a random polling (e.g. every 5 seconds), while triggering an update only when something changes.
At the time of writing, this API blocks the thread for 15 seconds, or unless something changes. To make it work, the client has to store inputs and areas IDs to get an update. This is not ideal but that's what the API offers.
Overview
Econnect API implements a long-polling in
/api/updates
endpoint. This change leverages this API to understand when the state is updated, so that it can trigger aclient.check()
call to get the latest. It prevents making a random polling (e.g. every 5 seconds), while triggering an update only when something changes.At the time of writing, this API blocks the thread for 15 seconds, or unless something changes. To make it work, the client has to store inputs and areas IDs to get an update. This is not ideal but that's what the API offers.