Package-level declarations
Types
The Worker class represents an independent JavaScript execution thread. Most Node.js APIs are available inside of it.
Properties
Functions
Within a worker thread, worker.getEnvironmentData() returns a clone of data passed to the spawning thread's worker.setEnvironmentData(). Every new Worker receives its own copy of the environment data automatically.
Check if an object is marked as not transferable with {@link markAsUntransferable}.
Mark an object as not cloneable. If object is used as message in a port.postMessage() call, an error is thrown. This is a no-op if object is a primitive value.
Mark an object as not transferable. If object occurs in the transfer list of a port.postMessage() call, it is ignored.
Transfer a MessagePort to a different vm Context. The original port object is rendered unusable, and the returned MessagePort instance takes its place.
Sends a value to another worker, identified by its thread ID.
Receive a single message from a given MessagePort. If no message is available,undefined is returned, otherwise an object with a single message property that contains the message payload, corresponding to the oldest message in the MessagePort's queue.
The worker.setEnvironmentData() API sets the content of worker.getEnvironmentData() in the current thread and all new Worker instances spawned from the current context.