WorkerComponent.call method
WorkerComponent › call
Calls a worker method.Signature:
call(method: TMethod, callArguments: Parameters<TApi[TMethod]>, options?: WorkerComponentCallOptions): Promise<WorkerMethodResult<TApi, TMethod>>Parameters:
| Parameter | Type | Description |
|---|---|---|
| method | TMethod | The method name. |
| callArguments | Parameters<TApi[TMethod]> | The method's arguments. |
| options? | WorkerComponentCallOptions | The 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.