Skip to main content

SpawnPreprocessor

Type Alias SpawnPreprocessor 

Source
pub type SpawnPreprocessor = Box<dyn Fn(&SpawnArgs) -> Pin<Box<dyn Future<Output = ()> + Send>> + Send>;
Expand description

An async hook the host awaits before servicing a top-level Spawn control op, so the daemon can do async preparation the sync spawner can’t - e.g. lazily connecting the blueprint’s MCP servers into the shared pool so they’re warm by the time Spawner reads them. The returned future is 'static (it must clone anything it needs from the SpawnArgs). Installed with WorldHost::set_spawn_preprocessor; when none is set, spawns proceed straight to the spawner.

Aliased Type§

pub struct SpawnPreprocessor(/* private fields */);