Expand description
Script registry lookup, context build, and async run lifecycle.
Resolves registered script handlers, builds execution context from stored actor JSON, and dispatches async runs with lifecycle events back to the runtime.
§Documentation map
- Register handlers —
ScriptRegistry, link-time inventory via#[chronon::script] - Dispatch runs —
Executor::spawn_run,execute_script - Observe lifecycle —
ExecutorEvent - Per-run log capture —
execute_scriptreturnsExecuteScriptOutcome::logs(chronon_telemetry::ChrononLogCapture); runtime persists on success and failure
§Concern → API
| Concern | API |
|---|---|
| Invoke + capture logs | execute_script → ExecuteScriptOutcome |
| Async dispatch | Executor::spawn_run |
| Lifecycle to runtime | ExecutorEvent (includes CapturedLogs) |
§Notes
Executor::spawn_run uses run-level params_json, not job defaults. Missing scripts
surface as ChrononError::ScriptNotFound.
Concurrent spawn_run work is capped by a semaphore (CHRONON_EXECUTOR_CONCURRENCY,
default 4); lifecycle events use a bounded channel (CHRONON_EVENT_CHANNEL_CAPACITY,
default 1024).
Structs§
- Execute
Script Outcome - Outcome of
execute_script: handler result plus captured tracing text. - Execute
Script Request - Inputs for a single script execution attempt.
- Executor
- Executor for running registered scripts against scheduled jobs.
- Script
Descriptor - Descriptor for a registered script.
- Script
Descriptor Ref - Borrowed view of a registered script suitable for invocation.
- Script
Registry - In-memory script registry with optional link-time inventory discovery.
Enums§
- Executor
Event - Event sent from the executor to the runtime for run status updates.
Constants§
- DEFAULT_
EVENT_ CHANNEL_ CAPACITY - Default capacity for the executor → runtime lifecycle event channel.
- DEFAULT_
EXECUTOR_ CONCURRENCY - Default max in-flight
Executor::spawn_runtasks.
Functions§
- event_
channel_ capacity_ from_ env - Reads
CHRONON_EVENT_CHANNEL_CAPACITY(defaultDEFAULT_EVENT_CHANNEL_CAPACITY). - execute_
script - Execute a script and capture tracing output for the run record.
- executor_
concurrency_ from_ env - Reads
CHRONON_EXECUTOR_CONCURRENCY(defaultDEFAULT_EXECUTOR_CONCURRENCY).
Type Aliases§
- Invoke
Fn - Type alias for the script invocation function.