Skip to main content

Worker

Trait Worker 

Source
pub trait Worker: Send + Sync {
    // Required methods
    fn descriptor(&self) -> &WorkerDescriptor;
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        request: ExecuteRequest,
        events: UnboundedSender<WorkerEvent>,
        cancel: CancellationToken,
    ) -> Pin<Box<dyn Future<Output = Result<ExecuteResult, RinneError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;

    // Provided method
    fn serves_mcp_tools(&self) -> bool { ... }
}
Expand description

A unit of work that can be dispatched to (CONTEXT.md §8).

Implementors normalize their underlying tool’s output into ExecuteResult. Streaming events go to the provided EventSink; cancellation is observed via the CancellationToken (used by /pause, budget kills, and stuck-detector aborts — CONTEXT.md §14).

Required Methods§

Source

fn descriptor(&self) -> &WorkerDescriptor

The worker’s self-description, used by the scheduler to resolve a node’s capability needs to a concrete worker.

Source

fn execute<'life0, 'async_trait>( &'life0 self, request: ExecuteRequest, events: UnboundedSender<WorkerEvent>, cancel: CancellationToken, ) -> Pin<Box<dyn Future<Output = Result<ExecuteResult, RinneError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Do one unit of work. Returns the normalized result, or an error if the worker could not be driven at all (distinct from a worker that ran and reported ExecStatus::Failed).

Provided Methods§

Source

fn serves_mcp_tools(&self) -> bool

Whether this worker can actually run a node’s attached MCP tools (MCP_SKILLS.md §6): an API worker with the host agentic loop wired, or a harness that can provision MCP servers into itself. The scheduler uses this to keep a tool node off a worker that would silently drop its tools. Default false — a worker opts in by overriding.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§