You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After recent discussion we decided that we need a bit more easier mechanism to subscribe for new events, or even just queue of newly created nodes. I propose following:
On startup we read last event counter, example name "last_event_id" , likely stored somewhere in mongodb, collection "preferences" or something like that, or maybe we keep preferences in redis. I believe redis with persistent storage should be better (faster).
When we receive event, we create new document, and assign to it ID = last event ID + 1, and update last_event_id in preferences.
we have endpoint /getevents?from=ID1&to=ID2, which returns all events (nodes) with IDs from ID1 to ID2. "to" is optional,
if not provided, return all events from ID1 to the last event. Also we can add option limit and simple filter by event type (checkout, kbuild, etc).
This will make for labs trivial to receive new events. They just need to store last event ID, and call /getevents?from=last_event_id+1&filterkind=kbuild
If there are no events, they will just get empty list.
The text was updated successfully, but these errors were encountered:
After recent discussion we decided that we need a bit more easier mechanism to subscribe for new events, or even just queue of newly created nodes. I propose following:
We use https://www.mongodb.com/docs/manual/core/index-ttl/ to remove more than N day old nodes in collection "events". This way we keep queue small. I propose to set N to 1 day
On startup we read last event counter, example name "last_event_id" , likely stored somewhere in mongodb, collection "preferences" or something like that, or maybe we keep preferences in redis. I believe redis with persistent storage should be better (faster).
When we receive event, we create new document, and assign to it ID = last event ID + 1, and update last_event_id in preferences.
we have endpoint /getevents?from=ID1&to=ID2, which returns all events (nodes) with IDs from ID1 to ID2. "to" is optional,
if not provided, return all events from ID1 to the last event. Also we can add option limit and simple filter by event type (checkout, kbuild, etc).
This will make for labs trivial to receive new events. They just need to store last event ID, and call /getevents?from=last_event_id+1&filterkind=kbuild
If there are no events, they will just get empty list.
The text was updated successfully, but these errors were encountered: