JsIsolatedWorker class abstract

An isolated worker spawning a single Web Worker

It's better to run importScripts first before going to use any javascript functions in the worker.

However it is not mandatory to do so if no javascript files are needed by the worker, e.g. the JSON.stringify function.

It will be mandatory to do so if there are external javascript files needed by the worker.

Constructors

JsIsolatedWorker()
Returns a singleton instance of JsIsolatedWorker
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Don't attempt to close when the app still needs the run function.
importScripts(List<String> scripts) Future<bool>
It's important to wait for importScripts to complete
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run({required dynamic functionName, required dynamic arguments, Future fallback()?}) Future
functionName can be a String or a List of String
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited