Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a check-in event scheduler, which schedules check-in events to be transmitted in a separate thread, with a minimum wait period of ten seconds between requests, and a wait period of a tenth of a second before the first request, referred to as "debounce" periods. This is a relatively minor improvement for the existing cron check-ins, but it is a requirement for the heartbeat check-ins, both to avoid slowing down customers' applications with blocking requests, and to avoid misuse of the feature from spamming our servers. The scheduler also acts as a deduplicator, removing "similar enough" check-in events -- again, not particularly interesting for cron check-ins, but a requirement to minimise damage when heartbeat check-ins are misused. Implement utility functions for serialising and deserialising NDJSON payloads. When an event is scheduled, the scheduler sets a timeout for the duration of the timeout period, after which the events stored in the scheduler are transmitted. When `Appsignal.stop` is called and awaited, the scheduler is gracefully stopped, awaiting the transmission of all scheduled check-in events. During this time, new check-in events cannot be scheduled.
- Loading branch information