isolate_manager library
Create multiple long-lived isolates for a function (keep it active to send and receive data), supports Worker and WASM on the Web.
Classes
-
IsolateManager<
R, P> - Create a new IsolateManager instance by using IsolateManager.create or IsolateManager.createCustom.
-
IsolateManagerController<
R, P> - This method only use to create a custom isolate.
- IsolateManagerFunction
- The helper functions for the IsolateManager.
- IsolateManagerWorker
- The annotation to generate a Worker JS for a specific method.
Enums
- IsolateState
- Isolate state
Constants
- isolateManagerCustomWorker → const IsolateManagerWorker
- An annotation that you want to use for the custom function.
-
All functions with this annotation will be combined and generated to the
$shared_worker.js
inside theweb
folder. - isolateManagerWorker → const IsolateManagerWorker
- A default annotation for the IsolateManagerWorker with empty name.
- Default shared worker name.
Typedefs
-
IsolateCallback<
R> = FutureOr< bool> Function(R value) - Type for the callback of the isolate.
-
IsolateConverter<
R> = R Function(dynamic) -
The type of the
converter
andworkerConverter
. -
IsolateCustomFunction
= IsolateFunction<
void, dynamic> -
Callback for the
createCustom
'sfunction
. -
IsolateFunction<
R, P> = FutureOr< R> Function(P params) -
The type of the
function
of the.create
method. -
IsolateOnDisposeCallback<
R, P> = void Function(IsolateManagerController< R, P> controller) - A callback for the IsolateManagerFunction.customFunction that will be executed only one time before all events.
-
IsolateOnEventCallback<
R, P> = FutureOr< R> Function(IsolateManagerController<R, P> controller, P message) -
A callback for the IsolateManagerFunction.customFunction that will be executed every time
the
message
is received from thesendMessage
orexecute
method. -
IsolateOnInitialCallback<
R, P, T> = FutureOr< void> Function(IsolateManagerController<R, P> controller, T initialParams) - A callback for the IsolateManagerFunction.customFunction that will be executed only one time before all events.
-
IsolateWorkerFunction<
R, P> = FutureOr< R> Function(P message) -
A function for the
IsolateManagerFunction.workerFunction
.
Exceptions / Errors
- IsolateException
-
This IsolateException mainly use to transfer an Exception between an
Isolate
and the main app.