method Worker.prototype.postMessageToThread
Jump to headingWorker.prototype.postMessageToThread(threadId: number,value: any,timeout?: number,): Promise<void>Sends a value to another worker, identified by its thread ID.
Parameters Jump to heading
Jump to headingthreadId: numberThe target thread ID. If the thread ID is invalid, a ERR_WORKER_MESSAGING_FAILED error will be thrown.
If the target thread ID is the current thread ID, a ERR_WORKER_MESSAGING_SAME_THREAD error will be thrown.
Jump to headingvalue: anyThe value to send.
optional
Jump to headingtimeout: numberTime to wait for the message to be delivered in milliseconds. By default it's undefined, which means wait forever.
If the operation times out, a ERR_WORKER_MESSAGING_TIMEOUT error is thrown.
Return Type Jump to heading
Promise<void>Jump to headingWorker.prototype.postMessageToThread(): Promise<void>Parameters Jump to heading
Jump to headingthreadId: numberJump to headingvalue: anyJump to headingtransferList: readonly TransferListItem[]optional
Jump to headingtimeout: numberReturn Type Jump to heading
Promise<void>