Interface BaseRestHandler.RequestBodyChunkConsumer

All Superinterfaces:
AutoCloseable, BaseRestHandler.RestChannelConsumer, CheckedConsumer<RestChannel,Exception>, Closeable, Releasable
Enclosing class:
BaseRestHandler

public static interface BaseRestHandler.RequestBodyChunkConsumer extends BaseRestHandler.RestChannelConsumer
  • Method Details

    • handleChunk

      void handleChunk(RestChannel channel, ReleasableBytesReference chunk, boolean isLast)
      Handle one chunk of the request body. The handler must close the chunk once it is no longer needed to avoid leaking.
      Parameters:
      channel - The rest channel associated to the request
      chunk - The chunk of request body that is ready for processing
      isLast - Whether the chunk is the last one of the request
    • streamClose

      default void streamClose()
      Called when the stream closes. This could happen prior to the completion of the request if the underlying channel was closed. Implementors should do their best to clean up resources and early terminate request processing if it is triggered before a response is generated.