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

DropNewestStrategy<R, P>
Remove the newest computation if the maxCount is exceeded.
DropOldestStrategy<R, P>
Remove the oldest computation if the maxCount is exceeded.
ImBool
A wrapper for bool values.
ImList
A wrapper for lists of ImType objects specific to Object types.
ImMap
A wrapper for maps with both keys and values of Object types.
ImNum
A wrapper for num values.
ImString
A wrapper for String values.
ImType<T extends Object>
An abstract wrapper for simple transferable types between the main thread and worker isolates.
IsolateManager<R, P>
Create a new IsolateManager instance by using IsolateManager.create, IsolateManager.createCustom or IsolateManager.createShared.
IsolateManagerController<R, P>
This method only use to create a custom isolate.
IsolateManagerCustomWorker
The annotation to generate a Worker JS for a specific method.
IsolateManagerFunction
The helper functions for the IsolateManager.
IsolateManagerShared
Create multiple long live isolates for computation. This method can be used to compute multiple functions.
IsolateManagerWorker
The annotation to generate a Worker JS for a specific method.
QueueStrategy<R, P>
Strategy to control a new (incoming) computation if the maximum number of Queues is reached.
RejectIncomingStrategy<R, P>
Discard the new incoming computation if the maxCount is exceeded.
UnlimitedStrategy<R, P>
Unlimited queued computations.

Enums

IsolateState
Isolate state

Constants

isolateManagerCustomWorker → const IsolateManagerCustomWorker
An annotation that you want to use for the custom function.
isolateManagerSharedWorker → const _IsolateManagerWorkerShared
All functions with this annotation will be combined and generated to the $shared_worker.js inside the web folder.
isolateManagerWorker → const IsolateManagerWorker
A default annotation for the IsolateManagerWorker with empty name.
kSharedWorkerName → const String
Default shared worker name.

Typedefs

IsolateCallback<R> = FutureOr<bool> Function(R value)
Type for the callback of the isolate.
IsolateConverter<R> = R Function(dynamic value)
The type of the converter and workerConverter.
IsolateExceptionFactory = IsolateException Function(Object error, StackTrace stackTrace)
A factory function type for creating IsolateException instances.
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 the sendMessage or execute method.
IsolateOnInitCallback<R, P> = FutureOr<void> Function(IsolateManagerController<R, P> controller)
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
An exception that can be safely transferred between isolates.
UnsupportedImTypeException
An exception thrown when an unsupported type is encountered during isolate operations.