postMessageToThreadAsync
fun postMessageToThreadAsync(threadId: Number, value: Any?, timeout: Number = definedExternally): ERROR CLASS: Symbol not found for Promise<ERROR CLASS: Symbol not found for js.core.Void>(source)
Sends a value to another worker, identified by its thread ID.
Since
v22.5.0
Parameters
threadId
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.
value
The value to send.
transferList
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.
timeout
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.
fun postMessageToThreadAsync(threadId: Number, value: Any?, transferList: ERROR CLASS: Symbol not found for ReadonlyArray<{node/workerThreads/Transferable=} kotlin/Any>, timeout: Number = definedExternally): ERROR CLASS: Symbol not found for Promise<ERROR CLASS: Symbol not found for js.core.Void>(source)