Skip to main content

worker_derived

Function worker_derived 

Source
pub fn worker_derived<I, R, E, P, C>(
    graph: &Graph,
    deps: Vec<Core>,
    prepare: P,
    compute: C,
    opts: GraphNodeOpts,
) -> Node<R>
where I: Send + 'static, R: Send + 'static, E: Display + Send + 'static, P: Fn(&Ctx) -> Option<I> + 'static, C: Fn(I) -> Result<R, E> + Send + Sync + 'static,
Expand description

Create an async-pool derived node whose CPU-heavy part runs on Tokio’s blocking worker pool.

prepare runs synchronously on the graph thread and must return an owned worker input. compute runs off-thread and may only close over Send + Sync state. The result or error comes back as a brand-new graph wave via DeferredCtx, preserving F-SYNC-CORE and D22.