public static class StreamConsumer.WrapAdapter<T> extends Object implements StreamConsumer<T>
StreamConsumer.ClosedHandlerSupport<T>, StreamConsumer.CloseHandlerSupport<T>, StreamConsumer.ListCollector<T>, StreamConsumer.NoBackpressure<T>, StreamConsumer.Phoenix<T>, StreamConsumer.ProcessorAsync<T>, StreamConsumer.ProcessorSync<T>, StreamConsumer.UnionSeq<T>, StreamConsumer.VoidConsumer<T>, StreamConsumer.WrapAdapter<T>
Modifier and Type | Field and Description |
---|---|
protected StreamHandler |
handler |
protected StreamConsumer<T> |
streamConsumer |
Constructor and Description |
---|
WrapAdapter(StreamConsumer<T> streamConsumer) |
Modifier and Type | Method and Description |
---|---|
void |
accept(T next)
Consumes an event.
|
void |
close(Throwable error)
Closes the consumer with
null on normal, not exceptional, close
or with an error on abnormal close. |
void |
flush()
The streams that receive / support flush pattern shall call
StreamConsumer.flush() method in order to
specify that a batch was completed. |
void |
opened(StreamHandler handler)
Notifies that stream is opened and passes request and close handler.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
authCtxAware, buffered, filterForwarder, mapForwarder, mapForwarder
protected volatile StreamHandler handler
protected final StreamConsumer<T> streamConsumer
public WrapAdapter(StreamConsumer<T> streamConsumer)
public void opened(StreamHandler handler)
StreamConsumer
opened
in interface StreamConsumer<T>
handler
- stream handlerpublic void accept(T next)
StreamConsumer
public void close(Throwable error)
StreamConsumer
null
on normal, not exceptional, close
or with an error on abnormal close.close
in interface StreamConsumer<T>
error
- null
if normal close or an error if abnormal termination occurred.public void flush()
StreamConsumer
StreamConsumer.flush()
method in order to
specify that a batch was completed. This allows such consumers to implement some buffer logic.flush
in interface StreamConsumer<T>
Copyright © 2022 Bosch.IO GmbH. All rights reserved.