ProcessPool class

A pool of worker processes that will keep numWorkers busy until all of the (presumably single-threaded) processes are finished.

Constructors

ProcessPool.new({int? numWorkers, ProcessRunner? processRunner, ProcessPoolProgressReporter? printReport = defaultPrintReport, Encoding encoding = const SystemEncoding()})

Properties

completedJobs int
Returns the number of jobs that have been completed
no setter
encoding Encoding
The decoder to use for decoding the stdout, stderr, and output of a process, and encoding the stdin from the job.
final
failedJobs int
Returns the number of jobs that have failed so far.
no setter
hashCode int
The hash code for this object.
no setterinherited
inProgressJobs int
Returns the number of jobs currently in progress.
no setter
numWorkers int
The number of workers to use for this pool.
final
pendingJobs int
Returns the number of jobs that are pending.
no setter
printReport ProcessPoolProgressReporter?
A function to be called periodically to update the progress on the pool.
final
processRunner ProcessRunner
The process runner to use when running the jobs in the pool.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
totalJobs int
Returns the total number of jobs that have been given to this pool.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runToCompletion(Iterable<DependentJob> jobs) Future<List<WorkerJob>>
Runs all of the jobs to completion, and returns a list of completed jobs when all have been completed.
startWorkers(Iterable<DependentJob> jobs) Stream<WorkerJob>
Runs the jobs in parallel, with at most numWorkers jobs running simultaneously.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

defaultPrintReport(int total, int completed, int inProgress, int pending, int failed) → void
The default report printing function, if one is not supplied.
defaultReportToString(int total, int completed, int inProgress, int pending, int failed) String