zng::task::ipc

Function run_worker

source
pub fn run_worker<I, O, F>(
    worker_name: impl Into<Txt>,
    handler: impl Fn(RequestArgs<I>) -> F + Send + Sync + 'static,
)
where I: IpcValue, O: IpcValue, F: Future<Output = O> + Send + Sync + 'static,
Expand description

If the process was started by a Worker runs the worker loop and never returns. If not started as worker does nothing.

The handler is called for each work request.