Package io.vertx.reactivex.grpc.server
Class GrpcServerRequest<Req,Resp>
- java.lang.Object
-
- io.vertx.reactivex.grpc.common.GrpcReadStream<Req>
-
- io.vertx.reactivex.grpc.server.GrpcServerRequest<Req,Resp>
-
- All Implemented Interfaces:
ReadStream<Req>,StreamBase
public class GrpcServerRequest<Req,Resp> extends GrpcReadStream<Req>
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<GrpcServerRequest>__TYPE_ARGTypeArg<Req>__typeArg_0TypeArg<Resp>__typeArg_1
-
Constructor Summary
Constructors Constructor Description GrpcServerRequest(GrpcServerRequest delegate)GrpcServerRequest(Object delegate, TypeArg<Req> typeArg_0, TypeArg<Resp> typeArg_1)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,A>
Future<R>collecting(Collector<Req,A,R> collector)HttpConnectionconnection()GrpcServerRequest<Req,Resp>endHandler(Handler<Void> endHandler)Set an end handler.booleanequals(Object o)GrpcServerRequest<Req,Resp>errorHandler(Handler<GrpcError> handler)Set a handler to be notified with gRPC errors.GrpcServerRequest<Req,Resp>exceptionHandler(Handler<Throwable> handler)Set an exception handler on the read stream.GrpcServerRequest<Req,Resp>fetch(long amount)Fetch the specifiedamountof elements.StringfullMethodName()GrpcServerRequestgetDelegate()GrpcServerRequest<Req,Resp>handler(Handler<Req> handler)Set a data handler.inthashCode()Future<Req>last()GrpcServerRequest<Req,Resp>messageHandler(Handler<GrpcMessage> handler)Set a handler to be notified with incoming encoded messages.StringmethodName()static <Req,Resp>
GrpcServerRequest<Req,Resp>newInstance(GrpcServerRequest arg)static <Req,Resp>
GrpcServerRequest<Req,Resp>newInstance(GrpcServerRequest arg, TypeArg<Req> __typeArg_Req, TypeArg<Resp> __typeArg_Resp)GrpcServerRequest<Req,Resp>pause()Pause theReadStream, it sets the buffer infetchmode and clears the actual demand.Pipe<Req>pipe()Pause this stream and return a to transfer the elements of this stream to a destination .voidpipeTo(WriteStream<Req> dst)Pipe thisReadStreamto theWriteStream.voidpipeTo(WriteStream<Req> dst, Handler<AsyncResult<Void>> handler)Pipe thisReadStreamto theWriteStream.GrpcServerResponse<Req,Resp>response()GrpcServerRequest<Req,Resp>resume()Resume reading, and sets the buffer inflowingmode.<R,A>
io.reactivex.Single<R>rxCollecting(Collector<Req,A,R> collector)io.reactivex.Single<Req>rxLast()io.reactivex.CompletablerxPipeTo(WriteStream<Req> dst)Pipe thisReadStreamto theWriteStream.ServiceNameserviceName()io.reactivex.Flowable<Req>toFlowable()io.reactivex.Observable<Req>toObservable()StringtoString()-
Methods inherited from class io.vertx.reactivex.grpc.common.GrpcReadStream
encoding, end, headers, newInstance, newInstance, rxEnd
-
-
-
-
Method Detail
-
toString
public String toString()
- Overrides:
toStringin classGrpcReadStream<Req>
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classGrpcReadStream<Req>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classGrpcReadStream<Req>
-
getDelegate
public GrpcServerRequest getDelegate()
- Specified by:
getDelegatein interfaceReadStream<Req>- Specified by:
getDelegatein interfaceStreamBase- Overrides:
getDelegatein classGrpcReadStream<Req>
-
toObservable
public io.reactivex.Observable<Req> toObservable()
- Specified by:
toObservablein interfaceReadStream<Req>- Overrides:
toObservablein classGrpcReadStream<Req>
-
toFlowable
public io.reactivex.Flowable<Req> toFlowable()
- Specified by:
toFlowablein interfaceReadStream<Req>- Overrides:
toFlowablein classGrpcReadStream<Req>
-
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 aWriteStream.- Specified by:
pipein interfaceReadStream<Req>- Overrides:
pipein classGrpcReadStream<Req>- Returns:
- a pipe
-
pipeTo
public void pipeTo(WriteStream<Req> dst, Handler<AsyncResult<Void>> handler)
Pipe thisReadStreamto theWriteStream.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
handlerwill be called with the result.- Specified by:
pipeToin interfaceReadStream<Req>- Overrides:
pipeToin classGrpcReadStream<Req>- Parameters:
dst- the destination write streamhandler-
-
pipeTo
public void pipeTo(WriteStream<Req> dst)
Pipe thisReadStreamto theWriteStream.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
handlerwill be called with the result.- Specified by:
pipeToin interfaceReadStream<Req>- Overrides:
pipeToin classGrpcReadStream<Req>- Parameters:
dst- the destination write stream
-
rxPipeTo
public io.reactivex.Completable rxPipeTo(WriteStream<Req> dst)
Pipe thisReadStreamto theWriteStream.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
handlerwill be called with the result.- Specified by:
rxPipeToin interfaceReadStream<Req>- Overrides:
rxPipeToin classGrpcReadStream<Req>- Parameters:
dst- the destination write stream- Returns:
-
last
public Future<Req> last()
- Overrides:
lastin classGrpcReadStream<Req>- Returns:
- the last element of the stream
-
rxLast
public io.reactivex.Single<Req> rxLast()
- Overrides:
rxLastin classGrpcReadStream<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
-
response
public GrpcServerResponse<Req,Resp> response()
- Returns:
- the response
-
messageHandler
public GrpcServerRequest<Req,Resp> messageHandler(Handler<GrpcMessage> handler)
Description copied from class:GrpcReadStreamSet a handler to be notified with incoming encoded messages. Thehandleris responsible for fully decoding incoming messages, including compression.- Overrides:
messageHandlerin classGrpcReadStream<Req>- Parameters:
handler- the message handler- Returns:
- a reference to this, so the API can be used fluently
-
errorHandler
public GrpcServerRequest<Req,Resp> errorHandler(Handler<GrpcError> handler)
Description copied from class:GrpcReadStreamSet a handler to be notified with gRPC errors.- Overrides:
errorHandlerin classGrpcReadStream<Req>- Parameters:
handler- the error handler- Returns:
- a reference to this, so the API can be used fluently
-
exceptionHandler
public GrpcServerRequest<Req,Resp> exceptionHandler(Handler<Throwable> handler)
Description copied from interface:ReadStreamSet an exception handler on the read stream.- Specified by:
exceptionHandlerin interfaceReadStream<Req>- Specified by:
exceptionHandlerin interfaceStreamBase- Overrides:
exceptionHandlerin classGrpcReadStream<Req>- Parameters:
handler- the exception handler- Returns:
- a reference to this, so the API can be used fluently
-
handler
public GrpcServerRequest<Req,Resp> handler(Handler<Req> handler)
Description copied from interface:ReadStreamSet a data handler. As data is read, the handler will be called with the data.- Specified by:
handlerin interfaceReadStream<Req>- Overrides:
handlerin classGrpcReadStream<Req>- Returns:
- a reference to this, so the API can be used fluently
-
pause
public GrpcServerRequest<Req,Resp> pause()
Description copied from interface:ReadStreamPause theReadStream, it sets the buffer infetchmode and clears the actual demand.While it's paused, no data will be sent to the data
handler.- Specified by:
pausein interfaceReadStream<Req>- Overrides:
pausein classGrpcReadStream<Req>- Returns:
- a reference to this, so the API can be used fluently
-
resume
public GrpcServerRequest<Req,Resp> resume()
Description copied from interface:ReadStreamResume reading, and sets the buffer inflowingmode. If theReadStreamhas been paused, reading will recommence on it.- Specified by:
resumein interfaceReadStream<Req>- Overrides:
resumein classGrpcReadStream<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:ReadStreamFetch the specifiedamountof elements. If theReadStreamhas been paused, reading will recommence with the specifiedamountof items, otherwise the specifiedamountwill be added to the current stream demand.- Specified by:
fetchin interfaceReadStream<Req>- Overrides:
fetchin classGrpcReadStream<Req>- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
public GrpcServerRequest<Req,Resp> endHandler(Handler<Void> endHandler)
Description copied from interface:ReadStreamSet an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.- Specified by:
endHandlerin interfaceReadStream<Req>- Overrides:
endHandlerin classGrpcReadStream<Req>- Returns:
- a reference to this, so the API can be used fluently
-
connection
public HttpConnection connection()
- Returns:
- the underlying HTTP connection
-
collecting
public <R,A> Future<R> collecting(Collector<Req,A,R> collector)
- Overrides:
collectingin classGrpcReadStream<Req>- Parameters:
collector-- Returns:
- the result of applying a collector on the stream
-
rxCollecting
public <R,A> io.reactivex.Single<R> rxCollecting(Collector<Req,A,R> collector)
- Overrides:
rxCollectingin classGrpcReadStream<Req>- Parameters:
collector-- Returns:
- the result of applying a collector on the stream
-
newInstance
public static <Req,Resp> GrpcServerRequest<Req,Resp> newInstance(GrpcServerRequest arg)
-
newInstance
public static <Req,Resp> GrpcServerRequest<Req,Resp> newInstance(GrpcServerRequest arg, TypeArg<Req> __typeArg_Req, TypeArg<Resp> __typeArg_Resp)
-
-