Executor class Null safety

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.
read / write
hashCode int
The hash code for this object.
read-onlyinherited
onChange Stream
Notifies the listeners about a state change in Executor, for example:
read-only
rate Rate?
The maximum rate of how frequently tasks can be started.
read / write
runningCount int
The number of tasks that are currently running.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
scheduledCount int
The total number of tasks scheduled (runningCount + waitingCount).
read-only
waitingCount int
The number of tasks that are currently waiting to be started.
read-only

Methods

close() Future
Closes the executor and reject tasks.
join({bool withWaiting = false}) Future
Returns a Future that completes when all currently running tasks complete.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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