pig/agent/tool_worker

Owned, cancellable execution for one tool call.

Types

An owned tool operation. Its execution process is hidden from callers.

pub opaque type Worker

Values

pub fn cancel(worker: Worker) -> Nil

Cancel this operation. Repeated calls are harmless.

pub fn start(
  registry: tool.ToolRegistry,
  call: message.ToolCall,
  notify: fn(Result(json.Json, tool.ToolError), Int) -> Nil,
) -> Worker

Start one tool operation and return before its handler executes.

Search Document