Class GrpcServerRequest<Req,​Resp>

    • Method Detail

      • pipe

        public Pipe<Req> 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<Req>
        Returns:
        a pipe
      • pipeTo

        public void pipeTo​(WriteStream<Req> 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<Req>
        Parameters:
        dst - the destination write stream
        handler -
      • pipeTo

        public void pipeTo​(WriteStream<Req> 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<Req>
        Parameters:
        dst - the destination write stream
      • rxPipeTo

        public rx.Single<Void> rxPipeTo​(WriteStream<Req> 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<Req>
        Parameters:
        dst - the destination write stream
        Returns:
      • last

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

        public rx.Single<Req> rxLast()
        Overrides:
        rxLast in class GrpcReadStream<Req>
        Returns:
        the last element of the stream
      • serviceName

        public ServiceName serviceName()
        Returns:
        the service name
      • methodName

        public String methodName()
        Returns:
        the method name
      • fullMethodName

        public String fullMethodName()
        Returns:
        the full method name sent by the client
      • messageHandler

        public GrpcServerRequest<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<Req>
        Parameters:
        handler - the message handler
        Returns:
        a reference to this, so the API can be used fluently
      • pause

        public GrpcServerRequest<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<Req>
        Returns:
        a reference to this, so the API can be used fluently
      • resume

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

        public GrpcServerRequest<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<Req>
        Returns:
        a reference to this, so the API can be used fluently
      • connection

        public HttpConnection connection()
        Returns:
        the underlying HTTP connection
      • invalidMessageHandler

        public GrpcReadStream<Req> 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<Req>
        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<Req,​A,​R> collector)
        Deprecated.
        Overrides:
        collecting in class GrpcReadStream<Req>
        Parameters:
        collector -
        Returns:
        the result of applying a collector on the stream
      • rxCollecting

        @Deprecated
        public <R,​A> rx.Single<R> rxCollecting​(Collector<Req,​A,​R> collector)
        Deprecated.
        Overrides:
        rxCollecting in class GrpcReadStream<Req>
        Parameters:
        collector -
        Returns:
        the result of applying a collector on the stream