Skip to main content
Module

x/nice_threads/mod.ts>NiceThread

A promise wrapper for JavaScript Workers, batteries included for Deno and Node.
Latest
class NiceThread
Re-export
import { NiceThread } from "https://deno.land/x/nice_threads@0.9.0/mod.ts";

A promise-based web worker wrapper for easy thread creation at runtime.

Constructors

new
NiceThread(worker: T)

Creates an instance of NiceThread with an async function for threaded work.

Properties

readonly
[Symbol.toStringTag]: string

Methods

call(...args: Parameters<T>): Promise<AwaitResult<T>>

Calls the function on the thread and returns a promise which will contain the result.

Terminates the thread and any pending work.