io.vertx.grpc.client

## Interface GrpcClientResponse<Req,Resp>

- All Superinterfaces:
    GrpcReadStream<Resp>, ReadStream<Resp>, StreamBase

      public interface GrpcClientResponse<Req,Resp>
      extends GrpcReadStream<Resp>

  A response from a gRPC server. You can set a `messageHandler(Handler)` to receive `GrpcMessage` and a `endHandler(Handler)` to be notified of the end of the response.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `GrpcClientResponse<Req,Resp>` | `endHandler(Handler<Void> handler)` Set an end handler.
    `GrpcClientResponse<Req,Resp>` | `errorHandler(Handler<GrpcError> handler)` Set a handler to be notified with gRPC errors.
    `GrpcClientResponse<Req,Resp>` | `exceptionHandler(Handler<Throwable> handler)` Set an exception handler on the read stream.
    `GrpcClientResponse<Req,Resp>` | `fetch(long amount)` Fetch the specified `amount` of elements.
    `GrpcClientResponse<Req,Resp>` | `handler(Handler<Resp> handler)` Set a data handler.
    `GrpcClientResponse<Req,Resp>` | `messageHandler(Handler<GrpcMessage> handler)` Set a handler to be notified with incoming encoded messages.
    `GrpcClientResponse<Req,Resp>` | `pause()` Pause the `ReadStream`, it sets the buffer in `fetch` mode and clears the actual demand.
    `GrpcClientResponse<Req,Resp>` | `resume()` Resume reading, and sets the buffer in `flowing` mode.
    `GrpcStatus` | `status()`
    `MultiMap` | `trailers()`

    - ### Methods inherited from interface io.vertx.grpc.common.GrpcReadStream

      `collecting, encoding, headers, last, pipeTo`

    - ### Methods inherited from interface io.vertx.core.streams.ReadStream

      `pipe, pipeTo`

- - ### Method Detail

    - #### status

          GrpcStatus status()

      Returns:
        the gRPC status or `null` when the status has not yet been received

    - #### trailers

          MultiMap trailers()

      Returns:
        the `MultiMap` to write metadata trailers

    - #### messageHandler

          GrpcClientResponse<Req,Resp> messageHandler(Handler<GrpcMessage> handler)

      Description copied from interface: `GrpcReadStream`
      Set a handler to be notified with incoming encoded messages. The `handler` is responsible for fully decoding incoming messages, including compression.
      Specified by:
        `messageHandler` in interface `GrpcReadStream<Resp>`
      Parameters:
        `handler` - the message handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### errorHandler

          GrpcClientResponse<Req,Resp> errorHandler(Handler<GrpcError> handler)

      Description copied from interface: `GrpcReadStream`
      Set a handler to be notified with gRPC errors.
      Specified by:
        `errorHandler` in interface `GrpcReadStream<Resp>`
      Parameters:
        `handler` - the error handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### exceptionHandler

          GrpcClientResponse<Req,Resp> exceptionHandler(Handler<Throwable> handler)

      Description copied from interface: `ReadStream`
      Set an exception handler on the read stream.
      Specified by:
        `exceptionHandler` in interface `GrpcReadStream<Resp>`
      Specified by:
        `exceptionHandler` in interface `ReadStream<Resp>`
      Specified by:
        `exceptionHandler` in interface `StreamBase`
      Parameters:
        `handler` - the exception handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### handler

          GrpcClientResponse<Req,Resp> handler(Handler<Resp> handler)

      Description copied from interface: `ReadStream`
      Set a data handler. As data is read, the handler will be called with the data.
      Specified by:
        `handler` in interface `GrpcReadStream<Resp>`
      Specified by:
        `handler` in interface `ReadStream<Resp>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### endHandler

          GrpcClientResponse<Req,Resp> endHandler(Handler<Void> handler)

      Description copied from interface: `ReadStream`
      Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
      Specified by:
        `endHandler` in interface `GrpcReadStream<Resp>`
      Specified by:
        `endHandler` in interface `ReadStream<Resp>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### pause

          GrpcClientResponse<Req,Resp> pause()

      Description copied from interface: `ReadStream`
      Pause the `ReadStream`, it sets the buffer in `fetch` mode and clears the actual demand.

      While it's paused, no data will be sent to the data `handler`.

      Specified by:
        `pause` in interface `GrpcReadStream<Resp>`
      Specified by:
        `pause` in interface `ReadStream<Resp>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### resume

          GrpcClientResponse<Req,Resp> resume()

      Description copied from interface: `ReadStream`
      Resume reading, and sets the buffer in `flowing` mode.

      If the `ReadStream` has been paused, reading will recommence on it.
      Specified by:
        `resume` in interface `GrpcReadStream<Resp>`
      Specified by:
        `resume` in interface `ReadStream<Resp>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### fetch

          GrpcClientResponse<Req,Resp> fetch(long amount)

      Description copied from interface: `ReadStream`
      Fetch the specified `amount` of elements. If the `ReadStream` has been paused, reading will recommence with the specified `amount` of items, otherwise the specified `amount` will be added to the current stream demand.
      Specified by:
        `fetch` in interface `GrpcReadStream<Resp>`
      Specified by:
        `fetch` in interface `ReadStream<Resp>`
      Returns:
        a reference to this, so the API can be used fluently

Copyright © 2022 Eclipse. All rights reserved.