Interface GrpcIoServer
- All Superinterfaces:
GrpcServer, Handler<HttpServerRequest>, ServiceContainer
A gRPC server based on Vert.x HTTP server.
This server extends the
GrpcServer to encode/decode messages in protobuf format using MethodDescriptor.
This server exposes 2 levels of handlers
- a Protobuf message
handler:GrpcServerRequest/GrpcServerResponsewith Protobuf message that handles any method call in a generic way - a gRPC message
handler:GrpcServerRequest/GrpcServerRequestwith gRPC messages that handles specific service method calls
-
Method Summary
Modifier and TypeMethodDescriptiondefault GrpcIoServeraddService(BindableService bindableService) LikeGrpcServer.addService(Service)with a gRPC/IOBindableService.<Req,Resp> GrpcIoServer callHandler(MethodDescriptor<Req, Resp> methodDesc, Handler<GrpcServerRequest<Req, Resp>> handler) Set a service method call handler that handles any call made to the server for theMethodDescriptorservice method.callHandler(Handler<GrpcServerRequest<Buffer, Buffer>> handler) Set a call handler that handles any call made to the server.static GrpcIoServerCreate a blank gRPC server with default options.static GrpcIoServerserver(Vertx vertx, GrpcServerOptions options) Create a blank gRPC server with specified options.Methods inherited from interface GrpcServer
addService, callHandlerMethods inherited from interface ServiceContainer
services
-
Method Details
-
server
Create a blank gRPC server with default options.- Returns:
- the created server
-
server
Create a blank gRPC server with specified options.- Parameters:
options- the gRPC server options- Returns:
- the created server
-
callHandler
Description copied from interface:GrpcServerSet a call handler that handles any call made to the server.- Specified by:
callHandlerin interfaceGrpcServer- Parameters:
handler- the service method call handler- Returns:
- a reference to this, so the API can be used fluently
-
callHandler
<Req,Resp> GrpcIoServer callHandler(MethodDescriptor<Req, Resp> methodDesc, Handler<GrpcServerRequest<Req, Resp>> handler) Set a service method call handler that handles any call made to the server for theMethodDescriptorservice method.- Parameters:
handler- the service method call handler- Returns:
- a reference to this, so the API can be used fluently
-
addService
LikeGrpcServer.addService(Service)with a gRPC/IOBindableService.
-