web_worker library

The entry a web worker script imports.

Web only: it is the code that runs inside the worker, and it touches the worker's global scope. The page imports package:dartvel_core/dartvel.dart as usual; the worker script imports this and registers the same tasks.

Classes

DVWorkerReporter
What a task is given to report through.
DVWorkerTasks
Tasks a web worker can be asked to run, by name.

Functions

dvWebWorkerMain() → void
Answers requests from the page. Call it from the worker script's main after registering the same tasks the page registered.

Typedefs

DVWorkerTask<I, O> = FutureOr<O> Function(I input, DVWorkerReporter reporter)
A task: a top-level or static function from a typed input to a typed output. That is what can cross an isolate boundary and what a web worker can be handed; a closure over the calling scope is neither.