Jobs and events
This page covers the work your app does outside a request: schedules that run an action on a timer, events an action announces, subscribers that react to them, and what happens when that work fails.
Three things start work, and each one calls an ordinary action, the kind of function that reads and writes stored records:
| Trigger | Starts when | Lives in |
|---|---|---|
| Route | A request arrives | routes/ (HTTP) |
| Schedule | A timer fires | schedules/ |
| Subscriber | An event it listens for is committed | subscribers/ |
All your logic lives in actions, so a reviewer reads one kind of code whatever started it. A schedule or a subscriber only adds when to run and what happens if it fails.
Two more things feed this work without being triggers of their own:
- Work over more items than one action can hold runs as a batch. An action starts it, and it calls an action for each item (Batches).
- The outside world produces events for your subscribers: webhooks, a package's own events and polls, and messages read from a queue (Events from outside).
Much of this page talks about the tick. The tick is the runtime's regular wake-up, once a minute in most apps: it runs the schedules that are due and picks up background work left over (The tick).
Markdown for agents: /docs/jobs-and-events.md.Built from Jadpo main at a707efb.