ConcurrencyExecutor class
An executor that limits the number of jobs running concurrently. Executes jobs in LIFO order, queueing additional jobs once the concurrency limit is reached. If the maximum queue size is reached, oldest jobs are completed with a CancellationException.
Constructors
- ConcurrencyExecutor({required Executor delegate, required int concurrencyLimit, required int maxQueueSize})
Properties
- concurrencyLimit → int
-
The maximum number of jobs that can execute concurrently
final
- delegate → Executor
-
The delegate used to execute jobs
final
- disposed → bool
-
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxQueueSize → int
-
The maximum number of queued jobs. Once this limit is reached,
submitting more jobs to the executor results in oldest jobs
completing with a CancellationException
final
- queueSize → int
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void -
called when done, cancels any oustanding jobs
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
submit<
Q, R> (Job< Q, R> job) → Future<R> -
override
-
submitAll<
Q, R> (Job< Q, R> job) → List<Future< R> > -
submits the given function and value to all isolates in the executor,
useful for cases where state must be set up in isolates prior to executing
jobs
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited