Optionaloptions: WorkersCronOptions
Logger for the unmatched-trigger and handler-failure paths
Runs every handler registered for the firing trigger's expression.
Handlers run to settlement — all of them are awaited even when some
reject, so one failing handler never abandons the others. After every
handler has settled, a rejection is REPORTED and then PROPAGATED as an
AggregateError, and a firing expression with no registered handler
throws: createScheduledHandler is a bare delegation, so the platform's
own response — counting the whole invocation as failed — becomes the
sink that needs no logger configuration (M70l X9-5). Breaking vs
earlier versions, where dispatch never rejected; an application that
wants the old fire-and-forget behaviour wraps its handlers in try.
The firing trigger
Resolves once every handler for the expression has settled, when none rejected and the expression had at least one handler
Every expression that has at least one handler.
Intended for an application to check against its own wrangler.toml, since
nothing in the process can read that file.
The registered expressions, in registration order
Registers a handler for a cron expression.
Several handlers may share one expression; all of them run, and one that
rejects does not prevent the others. The expression is matched exactly
against ScheduledController.cron, so it must be written the same way it
appears in wrangler.toml.
The cron expression, exactly as configured
Invoked when that trigger fires
This registry, for chaining
A registry of Cron Trigger handlers, keyed by cron expression.
The key is the expression rather than a name of our choosing because that is all the platform reports:
ScheduledController.cronis the exact string fromwrangler.toml. Both lists must agree — an expression registered here but absent from[triggers] cronsnever fires, and a trigger configured there with nothing registered here is reported through the logger on every occurrence.expressionsexists so an application can assert its own coverage.Example
Since
0.2.0