ReadonlyengineAn engine for a function of your own, with the effects registry as its
handlers. Its drainEffects fails on a pending effect the registry lacks
unless names leaves that effect out.
Run the pending effects this drain owns on the instance the event names:
a drain function's event, whose projection carries the instance _id.
Without options, the drain owns every 'function'-hosted effect that
declares no timeout or memory. With options.effect, it owns that one
effect, which must declare one of them. Throws when an effect failed or was
settled elsewhere during the run, so the platform records the invocation
as failed.
Optionaloptions: { effect: string }Re-queue the deployment's 'function'-hosted effects no drain picked up
within five minutes of being queued, on any instance in the partition that
holds one, releasing every expired claim on those instances, and tick every
in-flight instance of its 'function'-hosted workflows and no other. Runs
no effect handler.
Each step works on at most 30 instances per call, and later calls reach the
rest. Both steps run even when one fails;
the call throws afterwards when any instance failed. On an instance it
re-queues, a stale entry of an effect hosted elsewhere is re-queued too, and
no generated drain runs it.
Start the autonomous definitions applicable to the document a start
watcher's event carries.
Without options, the definitions whose start depends on no update; with
options.definition, that one definition, which must have a start watcher
of its own. Each start receives the document as its input-sourced subject,
referenced in the dataset the event came from. Throws a
ContractViolationError when the CreateRuntimeOptions.context
given to createRuntime lacks clientOptions.projectId or
clientOptions.dataset.
Each start is keyed on the definition, the event's dataset, the document
_id and its _rev, so calling start again with the same write, in
sequence or concurrently, starts no second instance. Throws a
ContractViolationError when the document has no _rev.
Optionaloptions: { definition: string }
What a generated Sanity Function calls: one verb per function kind, each taking the platform event.