Interface BufferConsumer

All Known Implementing Classes:
StreamingNettyByteBody.SharedBuffer

@Internal public interface BufferConsumer
This is a netty-specific 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.
Since:
4.5.0
Author:
Jonas Konrad
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    This interface manages the backpressure for data consumptions.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(io.netty.buffer.ByteBuf buf)
    Consume a buffer.
    void
    Signal normal completion of the stream.
    default void
    Signal that the upstream has discarded the remaining data, as requested by BufferConsumer.Upstream.allowDiscard().
    void
    Signal an upstream error.
  • Method Details

    • add

      void add(io.netty.buffer.ByteBuf buf)
      Consume a buffer. Release ownership is transferred to this consumer.
      Parameters:
      buf - The buffer to consume
    • complete

      void complete()
      Signal normal completion of the stream.
    • discard

      default void discard()
      Signal that the upstream has discarded the remaining data, as requested by BufferConsumer.Upstream.allowDiscard().
    • error

      void error(Throwable e)
      Signal an upstream error.
      Parameters:
      e - The error