Skip to content

WorkerPoolComponent.callAll method

WorkerPoolComponent › callAll

Calls a method on every worker with the same arguments, for instance to configure them all.

Signature:

callAll(method: TMethod, callArguments: Parameters<TApi[TMethod]>, abortSignal?: AbortSignal | undefined): Promise<WorkerMethodResult<TApi, TMethod>[]>

Parameters:

ParameterTypeDescription
methodTMethodThe method name.
callArgumentsParameters<TApi[TMethod]>The method's arguments, cloned for each worker; nothing can be transferred to all of them.
abortSignal?AbortSignal | undefinedCancels every call.

Returns: Promise<WorkerMethodResult<TApi, TMethod>[]> — The results, in worker order.