Expand description
Script execution context ports.
When a job is scheduled, Chronon stores actor_json on the job record. When a worker
dispatches the script, it calls ContextFactory::build to reconstruct handler context from
that JSON. Script handlers (including those defined with #[chronon::script]) receive the
result as Box<dyn ScriptContext>.
§Choosing a factory
| Approach | When to use |
|---|---|
JsonScriptContextFactory | Examples, smoke tests, and handlers that only need ScriptContext::label and ScriptContext::actor_json |
Custom ContextFactory | Production apps that map actor JSON to sessions, permissions, database access, or other application identity |
Install the factory at runtime boot on ChrononBuilder (see chronon-runtime).
Structs§
- Identity
Error - Identity reconstruction failure.
- Json
Script Context Factory - Default factory that wraps actor JSON in a labeled
ScriptContext. - NoOp
Context Factory - Factory that always returns
NoOpScriptContext. - NoOp
Script Context - No-op context for tests and benchmarks.
Traits§
- Context
Factory - Builds a
ScriptContextfrom JSON captured at schedule time. - Script
Context - Opaque execution context for script handlers.