ProcessorPool<R, I> class
setup multiple isolate process to run a given function with a common 2-way communication interface shared by all the isolates
Notes
- Startup time (worst-case, 4 isolates): 800ms (200ms/isolate)
- Force-kill time (worst-case, 4 isolates): 40ms (10ms/isolate)
Constructors
-
ProcessorPool.setupAsync(Future<
R> function(I input), [int processorCount = 4]) - setup a ProcessorPool that will run the provided (asynchronous) function
- ProcessorPool.setupSync(R function(I input), [int processorCount = 4])
- setup a ProcessorPool that will run the provided (synchronous) function
Properties
- function ↔ dynamic Function(I input)
-
the function being run
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
outputStream
→ Stream<
R> -
a Stream containing processed outputs
no setter
- processCount → int
-
number of processes on which the given function is being run
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
kill(
{bool awaitCompletion = true}) → Future< void> -
shutdown the
Processor
after currently supplied inputs are processed -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send(
I input) → void - send an input to be processed
-
start(
) → Future< void> - startup the ProcessorPool (creates the underlying Processors)
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited