Imported from darkostanimirovic/meanwhile (
pkg/scheduler/AGENTS.md). Install upstream withnpx skills add darkostanimirovic/meanwhile --skill scheduler. Copyright stays with the author.
Scheduler Package Notes (for coding agents)
Focus: pluggable scheduling drivers + polling worker.
Key types/flows
DriverpersistsJobrecords and must remove jobs returned byClaimDue.Workerpolls driver at an interval and dispatches via handler.- Drivers: in-memory (simple), Redis (sorted set + hash storage).
Contracts and pitfalls
ClaimDueshould be idempotent for a given job ID (remove when claimed).- Jobs are identified by
Job.IDand can be rescheduled by overwriting. - Prefer short handler work; treat worker as a poller, not a job runner.
Used by engine
- Timeout scheduling uses job type
human.request.timeoutand request ID as job ID.