Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/run.ts>WorkerTask

A JavaScript extension package for building strong and modern applications.
Latest
interface WorkerTask
import { type WorkerTask } from "https://deno.land/x/ayonli_jsext@v0.9.72/run.ts";

The return value of the run function.

Properties

workerId: number

The ID of the worker thread that runs the task.

Methods

result(): Promise<R>

Retrieves the return value of the function being called.

iterate(): AsyncIterable<R>

Iterates the yield value if the function being called returns a generator.

abort(reason?: Error | null): Promise<void>

Terminates the worker thread and aborts the task. If reason is provided, result() or iterate() will throw the error. Otherwise, the task will be aborted silently.