AsyncExecutor class

Asynchronous Executor of AsyncTask.

Available Extensions

Constructors

AsyncExecutor({String name = '', bool sequential = false, int? parallelism, double? parallelismPercentage, AsyncTaskRegister? taskTypeRegister, AsyncTaskLogger? logger})

Properties

hashCode int
The hash code for this object.
no setterinherited
info AsyncExecutorThreadInfo
no setter
isClosed bool
Returns true if this executor is already closed.
no setter
isClosing bool
Returns true if this executor is closing.
no setter
isReady bool
Returns true if this executor is ready to receive tasks to execute.
no setter
isStarted bool
no setter
logger AsyncTaskLoggerCaller
no setter
maximumWorkers int
no setter
name String
The name of this executor (for debug purposes).
final
parallelism int
Number of parallel executors (like Threads) to execute the tasks.
final
platform AsyncTaskPlatform
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sequential bool
If true the tasks will be executed sequentially, waiting each task to finished before start the next, in the order of execute call.
final
status AsyncExecutorStatus
no setter
taskTypeRegister AsyncTaskRegister?
A top-level function that returns the tasks types that can be executed by this executor.
final

Methods

close() Future<bool>
Closes this executor.
disposeSharedData<P, R>(Set<String> sharedDataSignatures, {bool async = false}) FutureOr<bool>
Disposes SharedData sent to other threads/isolates.
disposeSharedDataInfo<P, R>(AsyncExecutorSharedDataInfo sharedDataInfo, {bool async = false}) FutureOr<bool>
Disposes SharedData sent to other threads/isolates.
execute<P, R>(AsyncTask<P, R> task, {AsyncExecutorSharedDataInfo? sharedDataInfo}) Future<R>
Execute task using this executor.
executeAll<P, R>(Iterable<AsyncTask<P, R>> tasks, {AsyncExecutorSharedDataInfo? sharedDataInfo}) List<Future<R>>
Executes all the tasks using this executor. Calling execute for each task.
executeAllAndWaitResults<P, R>(Iterable<AsyncTask<P, R>> tasks, {AsyncExecutorSharedDataInfo? sharedDataInfo, bool disposeSentSharedData = false}) Future<List<R>>
Executes all the tasks using this executor and waits for the results.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() Future<bool>
Starts this executor. Any call to execute will call start if this is not started yet.
toString() String
A string representation of this object.
override

Operators

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

Static Properties

maximumParallelism int
The maximum number of threads/isolates that this process can have.
no setter

Static Methods

parameterParallelism({int? value, double? byPercentage}) int
Returns a valid parallelism parameter to use in constructor.