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 HttpConnection
connection()
Timer
deadline()
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 specifiedamount
of elements.String
fullMethodName()
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.String
methodName()
GrpcServerRequest<Req,Resp>
pause()
Pause theReadStream
, it sets the buffer infetch
mode and clears the actual demand.GrpcServerResponse<Req,Resp>
response()
GrpcServerRequest<Req,Resp>
resume()
Resume reading, and sets the buffer inflowing
mode.ServiceName
serviceName()
long
timeout()
-
Methods inherited from interface io.vertx.grpc.common.GrpcReadStream
encoding, end, format, headers, invalidMessageHandler, last
-
Methods inherited from interface io.vertx.core.streams.ReadStream
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:GrpcReadStream
Set a handler to be notified with incoming encoded messages. Thehandler
is responsible for fully decoding incoming messages, including compression.- Specified by:
messageHandler
in 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:GrpcReadStream
Set a handler to be notified with gRPC errors.- Specified by:
errorHandler
in 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:ReadStream
Set an exception handler on the read stream.- Specified by:
exceptionHandler
in interfaceGrpcReadStream<Req>
- Specified by:
exceptionHandler
in interfaceReadStream<Req>
- Specified by:
exceptionHandler
in 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:ReadStream
Set a data handler. As data is read, the handler will be called with the data.- Specified by:
handler
in interfaceGrpcReadStream<Req>
- Specified by:
handler
in interfaceReadStream<Req>
- Returns:
- a reference to this, so the API can be used fluently
-
pause
GrpcServerRequest<Req,Resp> pause()
Description copied from interface:ReadStream
Pause theReadStream
, it sets the buffer infetch
mode and clears the actual demand.While it's paused, no data will be sent to the data
handler
.- Specified by:
pause
in interfaceGrpcReadStream<Req>
- Specified by:
pause
in interfaceReadStream<Req>
- Returns:
- a reference to this, so the API can be used fluently
-
resume
GrpcServerRequest<Req,Resp> resume()
Description copied from interface:ReadStream
Resume reading, and sets the buffer inflowing
mode. If theReadStream
has been paused, reading will recommence on it.- Specified by:
resume
in interfaceGrpcReadStream<Req>
- Specified by:
resume
in 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:ReadStream
Fetch the specifiedamount
of elements. If theReadStream
has been paused, reading will recommence with the specifiedamount
of items, otherwise the specifiedamount
will be added to the current stream demand.- Specified by:
fetch
in interfaceGrpcReadStream<Req>
- Specified by:
fetch
in 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: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 interfaceGrpcReadStream<Req>
- Specified by:
endHandler
in 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
0L
if none.
-
deadline
Timer deadline()
- Returns:
- the request deadline or
null
when no deadline has been scheduled
-
-