Package io.vertx.grpc.server
Interface GrpcServerRequest<Req,Resp>
-
- All Superinterfaces:
GrpcReadStream<Req>,ReadStream<Req>,StreamBase
public interface GrpcServerRequest<Req,Resp> extends GrpcReadStream<Req>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpConnectionconnection()Timerdeadline()GrpcServerRequest<Req,Resp>endHandler(Handler<Void> endHandler)Set an end handler.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()GrpcServerRequest<Req,Resp>handler(Handler<Req> handler)Set a data handler.GrpcServerRequest<Req,Resp>messageHandler(Handler<GrpcMessage> handler)Set a handler to be notified with incoming encoded messages.StringmethodName()GrpcServerRequest<Req,Resp>pause()Pause theReadStream, it sets the buffer infetchmode and clears the actual demand.GrpcServerResponse<Req,Resp>response()GrpcServerRequest<Req,Resp>resume()Resume reading, and sets the buffer inflowingmode.ServiceNameserviceName()longtimeout()-
Methods inherited from interface io.vertx.grpc.common.GrpcReadStream
encoding, end, format, headers, invalidMessageHandler, last
-
Methods inherited from interface io.vertx.core.streams.ReadStream
blockingStream, collect, pipe, pipeTo
-
-
-
-
Method Detail
-
serviceName
ServiceName serviceName()
- Returns:
- the service name
-
methodName
String methodName()
- Returns:
- the method name
-
fullMethodName
String fullMethodName()
- Returns:
- the full method name sent by the client
-
response
GrpcServerResponse<Req,Resp> response()
- Returns:
- the response
-
messageHandler
GrpcServerRequest<Req,Resp> messageHandler(Handler<GrpcMessage> handler)
Description copied from interface:GrpcReadStreamSet a handler to be notified with incoming encoded messages. Thehandleris responsible for fully decoding incoming messages, including compression.- Specified by:
messageHandlerin interfaceGrpcReadStream<Req>- Parameters:
handler- the message handler- Returns:
- a reference to this, so the API can be used fluently
-
errorHandler
GrpcServerRequest<Req,Resp> errorHandler(Handler<GrpcError> handler)
Description copied from interface:GrpcReadStreamSet a handler to be notified with gRPC errors.- Specified by:
errorHandlerin interfaceGrpcReadStream<Req>- Parameters:
handler- the error handler- Returns:
- a reference to this, so the API can be used fluently
-
exceptionHandler
GrpcServerRequest<Req,Resp> exceptionHandler(Handler<Throwable> handler)
Description copied from interface:ReadStreamSet an exception handler on the read stream.- Specified by:
exceptionHandlerin interfaceGrpcReadStream<Req>- Specified by:
exceptionHandlerin interfaceReadStream<Req>- Specified by:
exceptionHandlerin interfaceStreamBase- Parameters:
handler- the exception handler- Returns:
- a reference to this, so the API can be used fluently
-
handler
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 interfaceGrpcReadStream<Req>- Specified by:
handlerin interfaceReadStream<Req>- Returns:
- a reference to this, so the API can be used fluently
-
pause
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 interfaceGrpcReadStream<Req>- Specified by:
pausein interfaceReadStream<Req>- Returns:
- a reference to this, so the API can be used fluently
-
resume
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 interfaceGrpcReadStream<Req>- Specified by:
resumein interfaceReadStream<Req>- Returns:
- a reference to this, so the API can be used fluently
-
fetch
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 interfaceGrpcReadStream<Req>- Specified by:
fetchin interfaceReadStream<Req>- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
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 interfaceGrpcReadStream<Req>- Specified by:
endHandlerin interfaceReadStream<Req>- Returns:
- a reference to this, so the API can be used fluently
-
connection
HttpConnection connection()
- Returns:
- the underlying HTTP connection
-
timeout
long timeout()
- Returns:
- the request timeout sent by the client or
0Lif none.
-
deadline
Timer deadline()
- Returns:
- the request deadline or
nullwhen no deadline has been scheduled
-
-