Package io.servicetalk.concurrent.api
Interface BufferStrategy.Accumulator<T,B>
-
- Type Parameters:
T
- Type of items added to thisBufferStrategy.Accumulator
.B
- Type of item created when an accumulation isfinished
.
- Enclosing interface:
- BufferStrategy<T,BC extends BufferStrategy.Accumulator<T,B>,B>
public static interface BufferStrategy.Accumulator<T,B>
An intermediate mutable object that holds items till it isfinished
.None of the methods on an instance of an
BufferStrategy.Accumulator
will be invoked concurrently and no other method will be called afterfinish()
returns.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
accumulate(T item)
Adds the passeditem
to thisBufferStrategy.Accumulator
.B
finish()
Finishes accumulation and returns the accumulated value.
-
-
-
Method Detail
-
accumulate
void accumulate(@Nullable T item)
Adds the passeditem
to thisBufferStrategy.Accumulator
.- Parameters:
item
- to add to thisBufferStrategy.Accumulator
.
-
finish
B finish()
Finishes accumulation and returns the accumulated value.- Returns:
- Accumulated value.
-
-