Module cron

Module cron 

Source
Expand description

Backend-neutral cron scheduler for dumb-pipe queue backends (SQS, Pub/Sub).

When running with a non-Apalis backend, Apalis’s CronStream + Monitor are not available. This module provides a lightweight tokio-based replacement that uses DistributedLock to prevent duplicate execution across instances.

The scheduler is shared by the SQS and Pub/Sub backends (SQS uses it via the SqsCronScheduler alias). Its distributed-lock keys are therefore backend-neutral and identical across backends: a fleet running both backends against one Redis forms a single lock domain per task and runs each cron at most once per interval. The lock keys MUST NOT embed the backend name.

Structs§

CronScheduler
Cron scheduler that runs periodic tasks using tokio timers and distributed locks for cross-instance coordination.