ImageWorkerPool class

Implemented types

Constructors

ImageWorkerPool(ConcurrencySettings concurrencySettings)

Properties

concurrencySettings → ConcurrencySettings
Concurrency settings.
finalinherited
fullStats Iterable<WorkerStat>
Full worker statistics.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
maxConcurrency int
Maximum running tasks.
no setterinherited
maxParallel int
Maximum tasks per worker.
no setterinherited
maxSize int
Maximum number of workers.
no setterinherited
maxWorkers int
Maximum workers.
no setterinherited
maxWorkload int
Maximum workload.
no setterinherited
minWorkers int
Minimum workers.
no setterinherited
operations Map<int, CommandHandler>
Worker pools do not need an operations map.
no setterinherited
pendingWorkload int
Gets remaining workload
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
Number of workers.
no setterinherited
stats Iterable<WorkerStat>
Worker statistics.
no setterinherited
stopped bool
Whether this pool is scheduled for stopping.
no setterinherited
totalErrors int
Number of errors.
no setterinherited
totalWorkload int
Total workload.
no setterinherited
workload int
Current workload.
no setterinherited

Methods

cancel([Task? task, String? message]) → void
Task cancellation. If a specific task is provided, only this task will be cancelled. Otherwise, all tasks registered with the WorkerPool are cancelled.
inherited
crop(Uint8List imageData, int x, int y, int width, int height) Future<String?>
override
execute<T>(Future<T> task(ImageWorker worker), {PerfCounter? counter}) Future<T>
Registers and schedules a task that returns a single value. Returns a future that completes with the task's value.
inherited
flip(Uint8List imageData, String axis) Future<String?>
override
gray(Uint8List imageData) Future<String?>
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerWorkerPoolListener(void listener(ImageWorker worker, bool removed)) Object
Registers a callback to be invoked when a worker thread is added or removed from the pool.
inherited
resize(Uint8List imageData, int width, int height) Future<String?>
override
scheduleStream<T>(Stream<T> task(ImageWorker worker), {PerfCounter? counter}) → StreamTask<T>
Registers and schedules a task that returns a stream of values. Returns a StreamTask
inherited
scheduleTask<T>(Future<T> task(ImageWorker worker), {PerfCounter? counter}) → ValueTask<T>
Registers and schedules a task that returns a single value. Returns a ValueTask
inherited
start() FutureOr<void>
Ensure at least ConcurrencySettings.minWorkers workers are started (defaulting to 1 if ConcurrencySettings.minWorkers is zero).
inherited
stop([bool predicate(ImageWorker worker)?]) int
Stop idle pool workers matching the predicate. If predicate is null or not provided, all workers will be stopped. Stopping a worker does not interrupt or cancel processing. Workers will complete pending tasks before shutting down. In the meantime, they will not receive any new workload. Returns the number of workers that have been stopped.
inherited
stream<T>(Stream<T> task(ImageWorker worker), {PerfCounter? counter}) Stream<T>
Registers and schedules a task that returns a stream of values. Returns a stream containing the task's values.
inherited
toString() String
A string representation of this object.
inherited
unregisterWorkerPoolListener({dynamic listener(ImageWorker worker, bool removed)?, Object? token}) → void
Unregisters a callback.
inherited

Operators

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