Creates a new DenoWorker instance and injects the given script.
The JavaScript that the worker should be started with.
Represents an event handler for the "exit" event. That is, a function to be called when the Deno worker process is terminated.
Represents an event handler for the "message" event, that is a function to be called when a message is recieved from the worker.
Adds the given listener for the "message" event.
The type of the event. (Always either "message" or "exit")
The listener to add for the event.
Adds the given listener for the "exit" event.
The type of the event. (Always either "message" or "exit")
The listener to add for the event.
Closes the websocket, which may allow the process to exit natually.
Sends a message to the worker.
The data to be sent. Copied via the Structured Clone algorithm so circular references are supported in addition to typed arrays.
Values that should be transferred. This should include any typed arrays that are referenced in the data.
Removes the given listener for the "message" event.
The type of the event. (Always either "message" or "exit")
The listener to remove for the event.
Removes the given listener for the "exit" event.
The type of the event. (Always either "message" or "exit")
The listener to remove for the event.
Terminates the worker and cleans up unused resources.
Generated using TypeDoc
The DenoWorker class is a WebWorker-like interface for interacting with Deno.
Because Deno is an isolated environment, this worker gives you the ability to run untrusted JavaScript code without potentially compromising your system.