The worker environment in the thread pool.
Tasks in the thread pool have access to the functions of this environment.
Classes
Methods
-
Exits the task manually.
-
Imports (Emscripten) WebAssembly from the given URL.
Properties:
Name Type Description wasmUrl
string The URL where to load the WebAssembly from.
Returns:
Type Description Promise A Promise resolving to the runtime instance. -
Creates a proxy for calling methods of the given object by another thread.
Name Type Description obj
object The object.
Returns:
Type Description object A proxy object for passing to other threads. -
The Shellfish module management is available in tasks.
- See:
-
- shRequire
-
Puts the worker thread to sleep for the given amount of milliseconds.
If the platform does not support
Atomics
, this function will perform a busy wait instead. -
Marks the given transferable object for transfer instead of copying.
So far, HTML5 recognizes
ArrayBuffer
,CanvasProxy
,ImageBitmap
, andMessagePort
as transferable.Name Type Description obj
Transferable The object to mark for transfer.
Returns:
Type Description Transferable The object to transfer.