CombineWorker class abstract
Combine Worker is a pool of CombineIsolates that efficiently executes tasks in them. It is primarily used to reduce the number of isolates and provide more performant and easy way to execute tasks.
In comparison to Fluter's compute method which creates an isolate each time it's called, Combine Worker creates a pool of isolates and efficiently reuses them. At the same time, it has all of the advantages of CombineIsolate, allowing you to work with platform channels in an isolate.
If you want to create a single CombineIsolate, take a look at Combine.
- Implementers
Constructors
- CombineWorker()
-
Combine Worker is a pool of CombineIsolates that efficiently executes
tasks in them. It is primarily used to reduce the number of isolates
and provide more performant and easy way to execute tasks.
factory
- CombineWorker.newInstance()
-
Creates a new instance of the CombineWorker.
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(
{bool waitForRemainingTasks = false}) → Future< void> - Closes the current Worker. CombineWorker is a singleton but under the hood it uses a worker manager instance which can be closed and recreated. It may be useful if you want to cancel all running and awaiting tasks (i. e. on user logout).
-
execute<
T> (Task< T> task) → Future<T> -
Executes given
task
in combine isolate. -
executeWith2Args<
T, Q, C> (Task2< T, Q, C> task, Q argument, C argument2) → Future<T> -
Executes given
task
with givenargument
andargument2
in combine isolate. -
executeWith3Args<
T, Q, C, A> (Task3< T, Q, C, A> task, Q argument, C argument2, A argument3) → Future<T> -
Executes given
task
with given arguments in combine isolate. -
executeWith4Args<
T, Q, C, A, B> (Task4< T, Q, C, A, B> task, Q argument, C argument2, A argument3, B argument4) → Future<T> -
Executes given
task
with given arguments in combine isolate. -
executeWith5Args<
T, Q, C, A, B, D> (Task5< T, Q, C, A, B, D> task, Q argument, C argument2, A argument3, B argument4, D argument5) → Future<T> -
Executes given
task
with given arguments in combine isolate. -
executeWithApply<
T> (TaskApply task, List positionalArguments, [Map< Symbol, dynamic> ? namedArguments]) → Future<T> -
Executes given
task
with given arguments in combine isolate. -
executeWithArg<
T, Q> (Task1< T, Q> task, Q argument) → Future<T> -
Executes given
task
with givenargument
in combine isolate. -
initialize(
{int? isolatesCount, int tasksPerIsolate = defaultTasksPerIsolate, WorkerInitializer? initializer, String isolatesPrefix = defaultIsolatePrefix}) → Future< void> - Initializes worker.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited