ZenithIsolateService<T, R> class
A background service that spawns a dedicated background Dart Isolate worker.
Spawns an isolate on start with a ReceivePort/SendPort pipeline for background event streams, and automatically terminates the isolate when the container scope disposes.
- Inheritance
-
- Object
- ZenithService
- ZenithIsolateService
Constructors
- ZenithIsolateService({required void entryPoint(SendPort sendPort), void onData(T data)?})
- Creates a ZenithIsolateService.
Properties
- entryPoint → void Function(SendPort sendPort)
-
Entry point function executed inside the background Isolate.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAlive → bool
-
Whether the background Isolate worker is currently active.
no setter
- onData → void Function(T data)?
-
Callback executed on the main thread whenever the background Isolate sends data.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onStart(
ZenithRef ref) → Future< void> -
Called when this service is registered with a ZenithRef.
override
-
onStop(
) → Future< void> -
Called when the owning ZenithContainer or ZenithRef scope is disposed/reset.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited