#[script]Expand description
Marks an async function as a Chronon script, enabling automatic registration and typed parameter handling.
§Requirements
- Function must be
async - First parameter must be
Box<dyn ScriptContext> - Return type must be
Result<()>(for examplechronon_core::Result<()>) nameattribute is required and must be unique- Parameters after
ScriptContextmust be simple identifiers
§Examples
ⓘ
#[chronon::script(name = "nightly_cleanup")]
async fn nightly_cleanup(
ctx: Box<dyn ScriptContext>,
retention_days: u32,
) -> chronon::Result<()> {
let _ = (ctx.label(), retention_days);
Ok(())
}