Sends a value to another worker, identified by its thread ID.
method
worker_threads.Worker.postMessageToThread
The 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.
The value to send.
Time 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.
Sends a value to another worker, identified by its thread ID.
The 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.
The value to send.
If one or more MessagePort
-like objects are passed in value, a transferList
is required for those items or ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST
is thrown. See port.postMessage()
for more information.
Time 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.