Interface TcpResponse

All Superinterfaces:
BaseResponse
All Known Subinterfaces:
Response, TcpResponse

public interface TcpResponse extends BaseResponse
Response specialized for TCP allowing piping traffic from client to backend.
Author:
Benoit BORDIGONI (benoit.bordigoni at graviteesource.com), GraviteeSource Team
  • Method Summary

    Modifier and Type
    Method
    Description
    io.reactivex.rxjava3.core.Flowable<Buffer>
    Get the current response body chunks as Flowable of Buffer.
    void
    chunks(io.reactivex.rxjava3.core.Flowable<Buffer> chunks)
    Set the current response body chunks from a Flowable of Buffer.
    void
    Setup internally a pipe downstream traffic bytes from backend to the client
  • Method Details

    • pipeDownstream

      void pipeDownstream()
      Setup internally a pipe downstream traffic bytes from backend to the client
    • chunks

      void chunks(io.reactivex.rxjava3.core.Flowable<Buffer> chunks)
      Set the current response body chunks from a Flowable of Buffer. This is useful to directly pump the upstream chunks to the downstream without having to load all the chunks in memory.

      WARN:

      • replacing the response chunks will NOT "drain" the previous response that was in place.
      • You MUST ensure to consume the previous chunks by yourself when using it.

      Parameters:
      chunks - the Flowable of chunks representing the response to push back to the downstream.
    • chunks

      io.reactivex.rxjava3.core.Flowable<Buffer> chunks()
      Get the current response body chunks as Flowable of Buffer. This is useful when you want to manipulate the entire body without having to load it in memory.

      WARN: you should not keep a direct reference on the body chunks as they could be overridden by others at anytime.

      Returns:
      a Flowable containing the current body response chunks.