Skip to content

Schedule, limit, chain and watch jobs, released as 0.7.0 - #2

Merged
zaiev merged 2 commits into
mainfrom
schedule-limit-chain-and-watch-jobs
Nov 17, 2026
Merged

zaiev merged 2 commits into
mainfrom
schedule-limit-chain-and-watch-jobs

Conversation

@zaiev

@zaiev zaiev commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Why

What a business system asks of a queue after the core -- periodic jobs, limits across runners, pausing in an incident, runners known to each other, jobs that wait for others, and somewhere to watch it all -- spool did not do, and an application wrote its own or went without.

Changes

  • Breaking: Spool.state has Blocked, for a job that waits for others; spool's new migrations must run before a runner of this version starts (rowtype-migrate up --source spool).
  • A queue's pause and limits live in its row, where every runner reads them: Spool.Queue.pause, resume and set_limits, limits across every runner, by rate, and per partition, partitions taken in turns.
  • Recurring jobs: Spool.Schedule.make, a cron expression read in a named time zone, one job a tick however many runners hold it.
  • Workflows: Spool.enqueue_after ~waits_for, run once every job it waits for completed, cancelled once one ends otherwise; Spool.workflow.
  • ~unique_for, Spool.enqueue_many, Spool.jobs, Spool.delete, Spool.run_again, Spool.Runner.list, Spool.Stats.since, sensitive kinds.
  • A new package, spool-dashboard: routes of the application's own Spindle server, who may do what decided by the application's own users through Spindle's Access, its page built in.
  • The guides gain "In a Spindle application", over a compiled example, and are brought up to date.
  • make lint runs litany; AGENTS.md keeps only what is spool's own.
  • 0.7.0 named in CHANGES.md.

Verified

  • make lint, litany among it, and make test: 77 tests, against a real Postgres.
  • make docs: the site built, its link check passing.
  • The dashboard example run by hand against two runners, a schedule, a limited partitioned queue and an import, in light and dark, at desktop and phone widths.
  • The Spindle example run by hand: a POST takes an order, its receipt sent by the runner beside the server, and a clean stop on SIGINT.

What a business system asks of a queue after the core -- periodic jobs,
limits across runners, pausing in an incident, runners known to each
other, jobs that wait for others, and somewhere to watch it all -- spool
did not do, and an application wrote its own or went without.

A queue's pause and limits live in its row, where every runner reads
them, and a limited queue is claimed under its lock, so two runners
cannot each half-obey a limit; partitions are taken in turns. A schedule's
tick is enqueued by the compare-and-set that moves it, so it is one job
with no leader. A workflow is the jobs connected by waiting, with no
object of its own. The dashboard is routes of the application's own
Spindle server, deciding who may do what by the application's own users
through Spindle's Access, and writing only through spool's functions;
its page is built and committed, so it installs with OCaml alone. The
guides gain a page on spool in a Spindle application.

AGENTS.md keeps only what is spool's own, and make lint runs litany, so
the rules a search held are held on every change; the page's generated
JSX is kept from the one rule its preprocessor trips.

The stages were to be released one by one; they ship together, since
the dashboard and the features it shows were tried as one.
CI installed solidtype 0.11.1, whose page code differs from 0.11.0's, so
its rebuild of the committed bundle differed; the bundle is now built on
it, and the ranges start there. 0.11.1 marks the props check around
each tag as generated, so litany no longer needs keeping from the page.
@zaiev
zaiev merged commit f1eae6e into main Nov 17, 2026
2 checks passed
@zaiev
zaiev deleted the schedule-limit-chain-and-watch-jobs branch November 17, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant