Looking for "design input" on a worker (my first) I'm writing.
The worker receive a message regularly from a client/device. I would like to detect (in the worker) when the client ceases to send the message (or it's significantly overdue).
So, it's like a snitch or a watchdog. There will be multiple clients, reporting at different times and periods.
I receive a message and it tells me when to expect the next one. What would be a design to detect that a client is overdue?
So far, my only thought is:
- when receiving a message, store in KV the time the next one is expected.
- trigger a worker via cron/timer at a period close to the shortest period of clients - and check if any times in the KV store are earlier than now
Any better way to do this?
So, it's like a snitch or a watchdog. There will be multiple clients, reporting at different times and periods.
I receive a message and it tells me when to expect the next one. What would be a design to detect that a client is overdue?
So far, my only thought is:
- when receiving a message, store in KV the time the next one is expected.
- trigger a worker via cron/timer at a period close to the shortest period of clients - and check if any times in the KV store are earlier than now
Any better way to do this?
