Skip to content

WorkerComponent.call method

WorkerComponent › call

Calls a worker method.

Signature:

call(method: TMethod, callArguments: Parameters<TApi[TMethod]>, options?: WorkerComponentCallOptions): Promise<WorkerMethodResult<TApi, TMethod>>

Parameters:

ParameterTypeDescription
methodTMethodThe method name.
callArgumentsParameters<TApi[TMethod]>The method's arguments.
options?WorkerComponentCallOptionsThe call options.

Returns: Promise<WorkerMethodResult<TApi, TMethod>> — The method's result. Rejects with a WorkerCallError when the handler failed, with the abort reason when the call was cancelled, and with an Error when the worker failed or the component unloaded first.