Class GrpcClientResponse<Req,​Resp>

    • Method Detail

      • pipe

        public Pipe<Resp> pipe()
        Pause this stream and return a to transfer the elements of this stream to a destination .

        The stream will be resumed when the pipe will be wired to a WriteStream.

        Specified by:
        pipe in interface ReadStream<Req>
        Overrides:
        pipe in class GrpcReadStream<Resp>
        Returns:
        a pipe
      • pipeTo

        public void pipeTo​(WriteStream<Resp> dst,
                           io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
        Pipe this ReadStream to the WriteStream.

        Elements emitted by this stream will be written to the write stream until this stream ends or fails.

        Once this stream has ended or failed, the write stream will be ended and the handler will be called with the result.

        Specified by:
        pipeTo in interface ReadStream<Req>
        Overrides:
        pipeTo in class GrpcReadStream<Resp>
        Parameters:
        dst - the destination write stream
        handler -
      • pipeTo

        public void pipeTo​(WriteStream<Resp> dst)
        Pipe this ReadStream to the WriteStream.

        Elements emitted by this stream will be written to the write stream until this stream ends or fails.

        Once this stream has ended or failed, the write stream will be ended and the handler will be called with the result.

        Specified by:
        pipeTo in interface ReadStream<Req>
        Overrides:
        pipeTo in class GrpcReadStream<Resp>
        Parameters:
        dst - the destination write stream
      • rxPipeTo

        public rx.Single<Void> rxPipeTo​(WriteStream<Resp> dst)
        Pipe this ReadStream to the WriteStream.

        Elements emitted by this stream will be written to the write stream until this stream ends or fails.

        Once this stream has ended or failed, the write stream will be ended and the handler will be called with the result.

        Specified by:
        rxPipeTo in interface ReadStream<Req>
        Overrides:
        rxPipeTo in class GrpcReadStream<Resp>
        Parameters:
        dst - the destination write stream
        Returns:
      • last

        public io.vertx.core.Future<Resp> last()
        Overrides:
        last in class GrpcReadStream<Resp>
        Returns:
        the last element of the stream
      • status

        public GrpcStatus status()
        Returns:
        the gRPC status or null when the status has not yet been received
      • statusMessage

        public String statusMessage()
        Returns:
        the gRPC status message of null when the status has not yet been received or not transmitted
      • trailers

        public MultiMap trailers()
        Returns:
        the to write metadata trailers
      • messageHandler

        public GrpcClientResponse<Req,​Resp> messageHandler​(io.vertx.core.Handler<GrpcMessage> handler)
        Description copied from class: GrpcReadStream
        Set a handler to be notified with incoming encoded messages. The handler is responsible for fully decoding incoming messages, including compression.
        Overrides:
        messageHandler in class GrpcReadStream<Resp>
        Parameters:
        handler - the message handler
        Returns:
        a reference to this, so the API can be used fluently
      • pause

        public 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 ReadStream<Req>
        Overrides:
        pause in class GrpcReadStream<Resp>
        Returns:
        a reference to this, so the API can be used fluently
      • fetch

        public 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 ReadStream<Req>
        Overrides:
        fetch in class GrpcReadStream<Resp>
        Returns:
        a reference to this, so the API can be used fluently
      • invalidMessageHandler

        public GrpcReadStream<Resp> invalidMessageHandler​(io.vertx.core.Handler<InvalidMessageException> handler)
        Set a message handler that is reported with invalid message errors.

        Warning: setting this handler overwrite the default handler which takes appropriate measure when an invalid message is encountered such as cancelling the stream. This handler should be set when control over invalid messages is required.

        Overrides:
        invalidMessageHandler in class GrpcReadStream<Resp>
        Parameters:
        handler - the invalid message handler
        Returns:
        a reference to this, so the API can be used fluently
      • collecting

        @Deprecated
        public <R,​A> io.vertx.core.Future<R> collecting​(Collector<Resp,​A,​R> collector)
        Deprecated.
        Overrides:
        collecting in class GrpcReadStream<Resp>
        Parameters:
        collector -
        Returns:
        the result of applying a collector on the stream