ProcessPool class

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

Constructors

ProcessPool({int numWorkers, ProcessRunner processRunner, ProcessPoolProgressReporter printReport: defaultPrintReport, Encoding encoding: const SystemEncoding()})

Properties

completedJobs int
Returns the number of jobs that have been completed
read-only
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.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
inProgressJobs int
Returns the number of jobs currently in progress.
read-only
numWorkers int
The number of workers to use for this pool. [...]
final
pendingJobs int
Returns the number of jobs that are pending.
read-only
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.
read-only, inherited
totalJobs int
Returns the total number of jobs that have been given to this pool.
read-only

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
runToCompletion(List<WorkerJob> jobs) Future<List<WorkerJob>>
Runs all of the jobs to completion, and returns a list of completed jobs when all have been completed. [...]
startWorkers(List<WorkerJob> jobs) Stream<WorkerJob>
Runs the jobs in parallel, with at most numWorkers jobs running simultaneously. [...]
toString() String
Returns 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.