Run automations: the scheduler, the run queue, webhooks and delivery.
The gateway fills the runtime through install-runtime!, so this namespace
never requires the gateway. A run row is the claim: one trigger occurrence
runs at most once. Runs of one automation run one after another. A queued or
running run of a stopped gateway becomes unknown and never runs again.
Run automations: the scheduler, the run queue, webhooks and delivery. The gateway fills the runtime through `install-runtime!`, so this namespace never requires the gateway. A run row is the claim: one trigger occurrence runs at most once. Runs of one automation run one after another. A queued or running run of a stopped gateway becomes unknown and never runs again.
(accept-webhook! db automation-id {:keys [headers body]})Check one webhook request and queue its run. headers have lower-case names
and body is the raw byte array. Answers {:status … :body …} or
{:status … :error [code message]}. Only a request with a valid signature uses
the rate limit, so a sender without the secret cannot block real requests.
Check one webhook request and queue its run. `headers` have lower-case names
and `body` is the raw byte array. Answers {:status … :body …} or
{:status … :error [code message]}. Only a request with a valid signature uses
the rate limit, so a sender without the secret cannot block real requests.(automation-session? sid)True while an automation run uses this session. Such a run cannot create, change, run or delete automations.
True while an automation run uses this session. Such a run cannot create, change, run or delete automations.
(busy? automation-id)True while a run of this automation is running or waiting.
True while a run of this automation is running or waiting.
(deliver-due! db)Send the due callbacks off the calling thread. One call drains the due callbacks batch by batch, so a backlog does not wait for later ticks.
Send the due callbacks off the calling thread. One call drains the due callbacks batch by batch, so a backlog does not wait for later ticks.
(fire-schedules! db from to once-from)Claim each schedule occurrence in (from, to]. A one-time trigger looks back
to once-from, so a missed one still starts once. A row and its due times stay
cached until the updated_at of the row changes.
Claim each schedule occurrence in (`from`, `to`]. A one-time trigger looks back to `once-from`, so a missed one still starts once. A row and its due times stay cached until the `updated_at` of the row changes.
(install-runtime! fns)Install the gateway functions that runs need:
:submit! [sid opts] blocks until the turn ends; answers the terminal result.:create-session! [opts] answers the wire map of a new session.:delete-session! [sid] deletes a session.:session? [sid] is true when the session exists.:notify! [alert] sends one phone alert.Install the gateway functions that runs need: - `:submit!` [sid opts] blocks until the turn ends; answers the terminal result. - `:create-session!` [opts] answers the wire map of a new session. - `:delete-session!` [sid] deletes a session. - `:session?` [sid] is true when the session exists. - `:notify!` [alert] sends one phone alert.
(overview db now)List every automation of this machine for the gateway and the Python host.
List every automation of this machine for the gateway and the Python host.
(quiet-turn? sid event)True for the turn of an automation run. The runner sends its own alert, so the ordinary turn alert stays quiet.
True for the turn of an automation run. The runner sends its own alert, so the ordinary turn alert stays quiet.
(recover! db)Mark the queued and running runs of stopped gateways as unknown. A run of a reused process ID counts as stopped.
Mark the queued and running runs of stopped gateways as unknown. A run of a reused process ID counts as stopped.
(run-now! db automation-id)Claim and start one manual run. Answers the run in its wire shape.
Claim and start one manual run. Answers the run in its wire shape.
(start! db-spec)Open the shared connection for the database spec db-spec, recover stopped runs
and start the scheduler. Answers a stop function. A failed recovery only logs a
warning, so it cannot stop the gateway.
Open the shared connection for the database spec `db-spec`, recover stopped runs and start the scheduler. Answers a stop function. A failed recovery only logs a warning, so it cannot stop the gateway.
(stop!)Stop the scheduler. Running turns finish on their own threads.
Stop the scheduler. Running turns finish on their own threads.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |