T
- type of the events this consumer will consumepublic interface StreamConsumer<T> extends Consumer<T>
Modifier and Type | Interface and Description |
---|---|
static class |
StreamConsumer.ClosedHandlerSupport<T> |
static class |
StreamConsumer.CloseHandlerSupport<T> |
static class |
StreamConsumer.ListCollector<T> |
static class |
StreamConsumer.NoBackpressure<T>
Provides a consumer wrapper that, once real consumer request with negative count
put the stream in no-backpressure mode.
|
static class |
StreamConsumer.Phoenix<T> |
static class |
StreamConsumer.ProcessorAsync<T> |
static class |
StreamConsumer.ProcessorSync<T> |
static class |
StreamConsumer.UnionSeq<T>
Sequential iteration of streams.
|
static class |
StreamConsumer.VoidConsumer<T> |
static class |
StreamConsumer.WrapAdapter<T> |
Modifier and Type | Method and Description |
---|---|
void |
accept(T next)
Consumes an event.
|
default StreamConsumer<T> |
authCtxAware()
Creates a consumer that keeps authentication context of its creation (if present)
and calls methods of
this with in contexts. |
default StreamConsumer<T> |
buffered(int bufferSize)
Creates new consumer that requests multiple events at once in order to allow the stream to re-deliver
request more effectively.
|
void |
close(Throwable error)
Closes the consumer with
null on normal, not exceptional, close
or with an error on abnormal close. |
default StreamConsumer<T> |
filterForwarder(Predicate<T> filter)
Creates new consumer that reads events from a stream, filter them using filter predicate
and forwards them to this stream.
|
default void |
flush()
The streams that receive / support flush pattern shall call
flush() method in order to
specify that a batch was completed. |
default <U> StreamConsumer<U> |
mapForwarder(Function<U,T> mapper)
Creates new consumer that reads events from a stream and forwards
them (mapping them with the mapper function) to this stream without skipping errors.
|
default <U> StreamConsumer<U> |
mapForwarder(Function<U,T> mapper,
boolean skipErrors)
Creates new consumer that reads events from a stream and forwards
them (mapping them with the mapper function) to this stream.
|
void |
opened(StreamHandler handler)
Notifies that stream is opened and passes request and close handler.
|
void opened(StreamHandler handler)
handler
- stream handlervoid close(Throwable error)
null
on normal, not exceptional, close
or with an error on abnormal close.error
- null
if normal close or an error if abnormal termination occurred.default void flush()
flush()
method in order to
specify that a batch was completed. This allows such consumers to implement some buffer logic.default <U> StreamConsumer<U> mapForwarder(Function<U,T> mapper)
U
- type of the events returned consumer will consume and map to Tmapper
- mapping, non-null, functiondefault <U> StreamConsumer<U> mapForwarder(Function<U,T> mapper, boolean skipErrors)
U
- type of the events returned consumer will consume and map to Tmapper
- mapping, non-null, functionskipErrors
- if to skip error thrown in mapper functiondefault StreamConsumer<T> filterForwarder(Predicate<T> filter)
filter
- filter, non-null, functiondefault StreamConsumer<T> buffered(int bufferSize)
bufferSize
- buffer sizedefault StreamConsumer<T> authCtxAware()
this
with in contexts.Copyright © 2022 Bosch.IO GmbH. All rights reserved.