IsolateContactor<R, P> class abstract

This IsolateContactor needs P as an input param type and R as a return type.

Constructors

IsolateContactor()

Properties

hashCode int
The hash code for this object.
no setterinherited
isComputing bool
Get current computing state of the isolate
no setter
onComputeState Stream<ComputeState>
Listen to the current state of isolate. Includes ComputeState.computed and ComputeState.computing
no setter
onMessage Stream<R>
Listen to the result from the isolate.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Close current isolate, the same behavior with dispose
dispose() Future<void>
Dispose current isolate
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
restart() Future<void>
Restart the paused isolate
sendMessage(P message) Future<R>
Send message to the function for computing
terminate() Future<void>
Close current isolate, the same behavior with dispose
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

debugLogPrefix String
Use this value to change the prefix debug log.
getter/setter pair

Static Methods

create<R, P>(IsolateFunction<R, P> function, {String workerName = '', IsolateConverter<R>? converter, IsolateConverter<R>? workerConverter, bool autoMarkAsInitialized = true, bool debugMode = false}) Future<IsolateContactor<R, P>>
The easy way to create isolate function
createCustom<R, P>(CustomIsolateFunction function, {String workerName = '', IsolateConverter<R>? converter, IsolateConverter<R>? workerConverter, bool autoMarkAsInitialized = true, Object? initialParams, bool debugMode = false}) Future<IsolateContactor<R, P>>
Create an instance with your custom isolate function.
createOwnIsolate<R, P>(CustomIsolateFunction function, {String workerName = '', IsolateConverter<R>? converter, IsolateConverter<R>? workerConverter, bool autoMarkAsInitialized = true, Object? initialParams, bool debugMode = false}) Future<IsolateContactor<R, P>>
Create an instance with your own isolate function