StreamingFutureBatcher<T> class

A variant of FutureBatcher that outputs results to a broadcast Stream as well as returned Futures.

It fully implements Sink.

Inheritance
Implemented types

Constructors

StreamingFutureBatcher(int threadCount)
StreamingFutureBatcher.from(Iterable<BatchedFutureGenerator<T>> generators, int threadCount, {bool closeWhenIdle = true})
Creates a batcher from an iterable of generators.

Properties

closeWhenIdle bool
Whether the batcher will close once idle or not.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isIdle bool
True if the batcher is in an idle state (no threads are running).
no setterinherited
queueIsEmpty bool
True if the queue is empty.
no setterinherited
queueLength int
The current length of the future queue.
no setterinherited
resultCount int
The number of results resolved so far.
no setter
results Stream<T>
The stream of results.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
threadCount int
The maximum amount of "thread"s to use to complete the futures in batches.
getter/setter pairinherited

Methods

add(BatchedFutureGenerator<T> generator) → void
Adds a future generator to the queue.
override
addAll(Iterable<BatchedFutureGenerator<T>> generators) → void
Adds several future generators to the queue.
override
close() → void
Closes the sink.
override
get(BatchedFutureGenerator<T> generator) Future<T>
Adds a future generator to the queue and completes with its result or error.
override
getAll(Iterable<BatchedFutureGenerator<T>> generators) List<Future<T>>
Adds several future generators to the queue and returns a list of futures that complete with their results or errors.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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