Skip to main content

FanOutSpawner

Trait FanOutSpawner 

Source
pub trait FanOutSpawner: Send + Sync {
    // Required method
    fn spawn_worker(
        &self,
        world: &mut World,
        parent: Entity,
        config: &FanOutConfig,
        item_id: &str,
        item_context: &Value,
    ) -> Result<Entity, String>;
}
Expand description

Starts one worker for a fan-out work item. The implementor resolves the worker’s blueprint (per config’s worker_stage / worker_agent / worker_query), spawns it into world seeded with the work item, and returns the child entity. Parent/child linking is done by fan_out_collect, not the spawner.

Required Methods§

Source

fn spawn_worker( &self, world: &mut World, parent: Entity, config: &FanOutConfig, item_id: &str, item_context: &Value, ) -> Result<Entity, String>

Spawn one worker under parent for the given work item, or Err with a human-readable reason (recorded as that item’s failure).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§