For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
once
def once[Emit: def() -> None & RegisterPassable & ImplicitlyCopyable, params: ContextParams, //](emit: Emit, ctx: Context[params])
CPU: runs emit unconditionally on the cooperative / tiled tiers (one worker per output), or gated on ctx._is_last_block on the split-axis tier (only the last-arriving worker emits).
emit is a value closure (its copy-captured state rides the value).
Parameters:
- βEmit (
def() -> None&RegisterPassable&ImplicitlyCopyable): The value-closure type ofemit. - βparams (
ContextParams): Comptime dispatch parameters.
Args:
- βemit (
Emit): Callback to run. - βctx (
Context[params]): The dispatch bundle.