Package io.micronaut.http.body.stream
Interface BufferConsumer
- All Known Subinterfaces:
ByteBufConsumer
- All Known Implementing Classes:
BaseSharedBuffer.AsFlux,ConcatenatingSubscriber,ConcatenatingSubscriber.ByteBufferConcatenatingSubscriber,ConcatenatingSubscriber.JsonByteBufferConcatenatingSubscriber,ReactiveByteBufferByteBody.SharedBuffer,StreamingNettyByteBody.SharedBuffer
This is a reactor-like API for streaming bytes. It's a bit better than reactor because it's more
explicit about reference counting semantics, has more fine-grained controls for cancelling, and
has more relaxed concurrency semantics.
This interface is buffer type agnostic. For specific buffer types (e.g. netty
This interface is buffer type agnostic. For specific buffer types (e.g. netty
ByteBuf)
there is a specific subinterface.- Since:
- 4.8.0
- Author:
- Jonas Konrad
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThis interface manages the backpressure for data consumptions. -
Method Summary
Modifier and TypeMethodDescriptionvoidcomplete()Signal normal completion of the stream.default voiddiscard()Signal that the upstream has discarded the remaining data, as requested byBufferConsumer.Upstream.allowDiscard().voidSignal an upstream error.
-
Method Details
-
complete
void complete()Signal normal completion of the stream. -
discard
default void discard()Signal that the upstream has discarded the remaining data, as requested byBufferConsumer.Upstream.allowDiscard(). -
error
Signal an upstream error.- Parameters:
e- The error
-