QuantizeServiceWorkerPool class base

Worker pool for QuantizeService

Implemented types
Available extensions

Constructors

QuantizeServiceWorkerPool({PlatformThreadHook? threadHook, ExceptionManager? exceptionManager, ConcurrencySettings? concurrencySettings})
QuantizeServiceWorkerPool.js({PlatformThreadHook? threadHook, ExceptionManager? exceptionManager, ConcurrencySettings? concurrencySettings})
QuantizeServiceWorkerPool.vm({PlatformThreadHook? threadHook, ExceptionManager? exceptionManager, ConcurrencySettings? concurrencySettings})
QuantizeServiceWorkerPool.wasm({PlatformThreadHook? threadHook, ExceptionManager? exceptionManager, ConcurrencySettings? concurrencySettings})

Properties

channelLogger ↔ Logger?
getter/setter pairinherited
concurrencySettings → ConcurrencySettings
Concurrency settings.
finalinherited
exceptionManager → ExceptionManager
no setterinherited
fullStats → Iterable<WorkerStat>
Full worker statistics.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
isReleased → bool
Returns true if the instance has been released, false otherwise.
no setterinherited
maxSize → int
Maximum number of workers.
no setterinherited
operations → OperationsMap
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

Methods

autoRelease(List<Releasable?> instances) → void
The autoRelease method is used to register a set of Releasable instances that will be automatically released when this instance becomes unreachable. Please note that this mechanism is based on Dart's Finalizer feature which makes no guarantee that it will ever be called. Depending on instance dependencies and their relationship with the internal Finalizer instance, it may even never be called. For instance, make sure this is never passed to autoRelease as this will create a cyclic graph of dependencies that will prevent finalization to happen.
inherited
cancel(Task task, [String? message]) → void
Task cancelation. If a specific task is provided, only this task will be canceled. Otherwise, all tasks registered with the WorkerPool are canceled.
inherited
cancelAll([String? message]) → void
Task cancelation. If a specific task is provided, only this task will be canceled. Otherwise, all tasks registered with the WorkerPool are canceled.
inherited
execute<T>(Future<T> task(QuantizeServiceWorker 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
getLocalWorker([ExceptionManager? exceptionManager]) → LocalWorker<QuantizeService>

Available on QuantizeService, provided by the $QuantizeServiceLocalWorkerExt extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
quantize(List<int> argbs, int maxColors) → Future<QuantizerResult>
override
registerWorkerPoolListener(void listener(WorkerStat, bool)) → Object
Registers a callback to be invoked when a worker thread is added or removed from the pool.
inherited
release() → void
The release method must be overriden in derived classes to clean up any resources they use. Implementations should not throw and must call super.release() in a finally block. If a derived class defines Releasable fields, these fields should be released of in this method. Note for implementers: it should be safe to call this method several times.
inherited
scheduleStreamTask<T>(Stream<T> task(QuantizeServiceWorker worker), {PerfCounter? counter}) → StreamTask<T>
Registers and schedules a task that returns a stream of values. Returns a StreamTask.
inherited
scheduleValueTask<T>(Future<T> task(QuantizeServiceWorker worker), {PerfCounter? counter}) → ValueTask<T>
Registers and schedules a task that returns a single value. Returns a ValueTask.
inherited
start() → Future<void>
Ensure at least ConcurrencySettings.minWorkers workers are started (defaulting to 1 if ConcurrencySettings.minWorkers is zero).
inherited
stop([bool predicate(QuantizeServiceWorker 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(QuantizeServiceWorker 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
terminate([TaskTerminatedException? ex]) → void
inherited
toString() → String
A string representation of this object.
inherited
track() → void
Implementations should call this method e.g. at construction time to make sure they will be trackable in debugging scenarios. See ReleasableTracker.enable for more information.
inherited
unregisterWorkerPoolListener({dynamic listener(WorkerStat, bool)?, Object? token}) → void
Unregisters a callback.
inherited

Operators

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