Executor class abstract

Executes async tasks with a configurable maximum concurrency and rate.

Constructors

Executor({int concurrency = 1, Rate? rate})
Async task executor.
factory

Properties

concurrency int
The maximum number of tasks running concurrently.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
onChange Stream
Notifies the listeners about a state change in Executor, for example:
no setter
rate Rate?
The maximum rate of how frequently tasks can be started.
getter/setter pair
runningCount int
The number of tasks that are currently running.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scheduledCount int
The total number of tasks scheduled (runningCount + waitingCount).
no setter
waitingCount int
The number of tasks that are currently waiting to be started.
no setter

Methods

close() Future
Closes the executor and reject tasks.
join({bool withWaiting = false}) Future<List<Object?>>
Returns a Future that completes when all currently running tasks complete.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scheduleStream<R>(StreamTask<R> task) Stream<R>
Schedules an async task and returns its stream. The task is considered running until the stream is closed.
scheduleTask<R>(AsyncTask<R> task) Future<R>
Schedules an async task and returns with a future that completes when the task is finished. Task may not get executed immediately.
toString() String
A string representation of this object.
inherited

Operators

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