IsolateWorkerPool class

Constructors

IsolateWorkerPool({int numIsolates = 1, bool useLogger = false})

Properties

events Stream<IsolateWorkerPoolEvent>
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
useLogger bool
final

Methods

add({String? tag}) Future<void>
Adds a new worker to the pool and starts it.
getWorkerTags() List<String>
Returns a list of all worker tags in the pool.
killAll() → void
Terminates all workers in the pool.
killByTag(String tag) → void
Terminates the worker with the given tag.
killByTags(List<String> tags) → void
Terminates all workers with the given tags.
listenWorkerEvents() Stream<IsolateWorkerEvent>
Returns a stream of all worker events in the pool.
listenWorkerEventsByTag(String tag) Stream<IsolateWorkerEvent>
Returns a stream of events for the worker with the given tag.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pauseAll() → void
Pauses all workers in the pool.
pauseWorker(String tag) → void
Pauses the worker with the given tag.
resumeAll() → void
Resumes all workers in the pool.
resumeWorker(String tag) → void
Resumes the worker with the given tag.
sendMessage<T, R>(WorkerMessage<T, R> message) Future<R>
Sends a WorkerMessage to the next available worker in round-robin order.
sendMessageToTag<T, R>(String tag, WorkerMessage<T, R> message) Future<R>
Sends a WorkerMessage to the worker with the given tag.
start() Future<void>
Starts all workers in the pool.
toString() String
A string representation of this object.
inherited

Operators

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