CombineBackPressureStrategy<Q, R> class
An implementation of BackpressureStrategy that allows for manual merge of input data for calls to the isolate function.
This back pressure strategy uses the _combineFunction
to merge the input
data from all calls to the isolate function on back pressure.
To create a tailored isolate that multiplies an integer input:
final isolate = Isolated.tailored<int, int>(
backpressureStrategy: CombineBackPressureStrategy(
(oldData, newData) => oldData * newData,
),
);
Marble diagram to visualize timeline:
--a--b--c---d--e--f-g---------|
---------a-bc-------d--ef*g-|
- Inheritance
-
- Object
- BackpressureStrategy<
Q, R> - CombineBackPressureStrategy
Constructors
- CombineBackPressureStrategy(Q _combineFunction(Q oldData, Q newData))
- Creates a back pressure strategy that combines input data on back pressure.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
queue
↔ BackpressureConfiguration<
Q, R> ? -
The next item in queue for execution.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
BackpressureConfiguration< Q, R> configuration) → void -
Adds another job to the queue.
override
-
dispose(
) → Future -
Clears the queue and cleans up.
inherited
-
drop(
BackpressureConfiguration configuration) → void -
Drops the job item, completing it with an error.
inherited
-
hasNext(
) → bool -
Function that returns true if the back pressure strategy has a job in
queue.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
takeNext(
) → BackpressureConfiguration< Q, R> -
Function that returns the next job in queue.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited