@java.lang.Override @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver<Req> invoke( io.grpc.stub.StreamObserver<Resp> responseObserver) { switch (methodId) { case METHODID_STREAMING_INPUT_CALL: io.vertx.grpc.GrpcReadStream<io.vertx.example.grpc.Messages.StreamingInputCallRequest> request0 = io.vertx.grpc.GrpcReadStream.<io.vertx.example.grpc.Messages.StreamingInputCallRequest>create(); serviceImpl.streamingInputCall(request0, (io.vertx.core.Future<io.vertx.example.grpc.Messages.StreamingInputCallResponse>) io.vertx.core.Future.<io.vertx.example.grpc.Messages.StreamingInputCallResponse>future().setHandler(ar -> { if (ar.succeeded()) { ((io.grpc.stub.StreamObserver<io.vertx.example.grpc.Messages.StreamingInputCallResponse>) responseObserver).onNext(ar.result()); responseObserver.onCompleted(); } else { responseObserver.onError(ar.cause()); } })); return (io.grpc.stub.StreamObserver<Req>) request0.readObserver(); default: throw new AssertionError(); } } }
@java.lang.Override @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver<Req> invoke( io.grpc.stub.StreamObserver<Resp> responseObserver) { switch (methodId) { case METHODID_FULL_DUPLEX_CALL: io.vertx.grpc.GrpcReadStream<io.vertx.example.grpc.Messages.StreamingOutputCallRequest> request0 = io.vertx.grpc.GrpcReadStream.<io.vertx.example.grpc.Messages.StreamingOutputCallRequest>create(); serviceImpl.fullDuplexCall( io.vertx.grpc.GrpcBidiExchange.<io.vertx.example.grpc.Messages.StreamingOutputCallRequest, io.vertx.example.grpc.Messages.StreamingOutputCallResponse>create( request0, (io.grpc.stub.StreamObserver<io.vertx.example.grpc.Messages.StreamingOutputCallResponse>) responseObserver)); return (io.grpc.stub.StreamObserver<Req>) request0.readObserver(); default: throw new AssertionError(); } } }
/** * <pre> * One request followed by a sequence of responses (streamed download). * The server returns the payload with client desired type and sizes. * </pre> */ public void streamingOutputCall(io.vertx.example.grpc.Messages.StreamingOutputCallRequest request, io.vertx.core.Handler<io.vertx.grpc.GrpcReadStream<io.vertx.example.grpc.Messages.StreamingOutputCallResponse>> handler) { final io.vertx.grpc.GrpcReadStream<io.vertx.example.grpc.Messages.StreamingOutputCallResponse> readStream = io.vertx.grpc.GrpcReadStream.<io.vertx.example.grpc.Messages.StreamingOutputCallResponse>create(); handler.handle(readStream); asyncServerStreamingCall( getChannel().newCall(getStreamingOutputCallMethod(), getCallOptions()), request, readStream.readObserver()); } }
@java.lang.Override @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver<Req> invoke( io.grpc.stub.StreamObserver<Resp> responseObserver) { switch (methodId) { case METHODID_RECORD_ROUTE: io.vertx.grpc.GrpcReadStream<io.grpc.examples.routeguide.Point> request2 = io.vertx.grpc.GrpcReadStream.<io.grpc.examples.routeguide.Point>create(); serviceImpl.recordRoute(request2, (io.vertx.core.Future<io.grpc.examples.routeguide.RouteSummary>) io.vertx.core.Future.<io.grpc.examples.routeguide.RouteSummary>future().setHandler(ar -> { if (ar.succeeded()) { ((io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.RouteSummary>) responseObserver).onNext(ar.result()); responseObserver.onCompleted(); } else { responseObserver.onError(ar.cause()); } })); return (io.grpc.stub.StreamObserver<Req>) request2.readObserver(); case METHODID_ROUTE_CHAT: io.vertx.grpc.GrpcReadStream<io.grpc.examples.routeguide.RouteNote> request3 = io.vertx.grpc.GrpcReadStream.<io.grpc.examples.routeguide.RouteNote>create(); serviceImpl.routeChat( io.vertx.grpc.GrpcBidiExchange.<io.grpc.examples.routeguide.RouteNote, io.grpc.examples.routeguide.RouteNote>create( request3, (io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.RouteNote>) responseObserver)); return (io.grpc.stub.StreamObserver<Req>) request3.readObserver(); default: throw new AssertionError(); } } }
/** * <pre> * A server-to-client streaming RPC. * Obtains the Features available within the given Rectangle. Results are * streamed rather than returned at once (e.g. in a response message with a * repeated field), as the rectangle may cover a large area and contain a * huge number of features. * </pre> */ public void listFeatures(io.grpc.examples.routeguide.Rectangle request, io.vertx.core.Handler<io.vertx.grpc.GrpcReadStream<io.grpc.examples.routeguide.Feature>> handler) { final io.vertx.grpc.GrpcReadStream<io.grpc.examples.routeguide.Feature> readStream = io.vertx.grpc.GrpcReadStream.<io.grpc.examples.routeguide.Feature>create(); handler.handle(readStream); asyncServerStreamingCall( getChannel().newCall(getListFeaturesMethod(), getCallOptions()), request, readStream.readObserver()); }
/** * <pre> * A client-to-server streaming RPC. * Accepts a stream of Points on a route being traversed, returning a * RouteSummary when traversal is completed. * </pre> */ public void recordRoute(io.vertx.core.Handler< io.vertx.grpc.GrpcUniExchange<io.grpc.examples.routeguide.Point, io.grpc.examples.routeguide.RouteSummary>> handler) { final io.vertx.grpc.GrpcReadStream<io.grpc.examples.routeguide.RouteSummary> readStream = io.vertx.grpc.GrpcReadStream.<io.grpc.examples.routeguide.RouteSummary>create(); handler.handle(io.vertx.grpc.GrpcUniExchange.create(readStream, asyncClientStreamingCall( getChannel().newCall(getRecordRouteMethod(), getCallOptions()), readStream.readObserver()))); }
/** * <pre> * A sequence of requests followed by one response (streamed upload). * The server returns the aggregated size of client payload as the result. * </pre> */ public void streamingInputCall(io.vertx.core.Handler< io.vertx.grpc.GrpcUniExchange<io.vertx.example.grpc.Messages.StreamingInputCallRequest, io.vertx.example.grpc.Messages.StreamingInputCallResponse>> handler) { final io.vertx.grpc.GrpcReadStream<io.vertx.example.grpc.Messages.StreamingInputCallResponse> readStream = io.vertx.grpc.GrpcReadStream.<io.vertx.example.grpc.Messages.StreamingInputCallResponse>create(); handler.handle(io.vertx.grpc.GrpcUniExchange.create(readStream, asyncClientStreamingCall( getChannel().newCall(getStreamingInputCallMethod(), getCallOptions()), readStream.readObserver()))); } }
/** * <pre> * A Bidirectional streaming RPC. * Accepts a stream of RouteNotes sent while a route is being traversed, * while receiving other RouteNotes (e.g. from other users). * </pre> */ public void routeChat(io.vertx.core.Handler< io.vertx.grpc.GrpcBidiExchange<io.grpc.examples.routeguide.RouteNote, io.grpc.examples.routeguide.RouteNote>> handler) { final io.vertx.grpc.GrpcReadStream<io.grpc.examples.routeguide.RouteNote> readStream = io.vertx.grpc.GrpcReadStream.<io.grpc.examples.routeguide.RouteNote>create(); handler.handle(io.vertx.grpc.GrpcBidiExchange.create(readStream, asyncBidiStreamingCall( getChannel().newCall(getRouteChatMethod(), getCallOptions()), readStream.readObserver()))); } }
/** * <pre> * A sequence of requests with each request served by the server immediately. * As one request could lead to multiple responses, this interface * demonstrates the idea of full duplexing. * </pre> */ public void fullDuplexCall(io.vertx.core.Handler< io.vertx.grpc.GrpcBidiExchange<io.vertx.example.grpc.Messages.StreamingOutputCallResponse, io.vertx.example.grpc.Messages.StreamingOutputCallRequest>> handler) { final io.vertx.grpc.GrpcReadStream<io.vertx.example.grpc.Messages.StreamingOutputCallResponse> readStream = io.vertx.grpc.GrpcReadStream.<io.vertx.example.grpc.Messages.StreamingOutputCallResponse>create(); handler.handle(io.vertx.grpc.GrpcBidiExchange.create(readStream, asyncBidiStreamingCall( getChannel().newCall(getFullDuplexCallMethod(), getCallOptions()), readStream.readObserver()))); } }
@Override public StreamObserver<I> readObserver() { return readStream.readObserver(); }
/** * <pre> * Full: Client -> Server -> Client * </pre> */ public void dupliexCall(io.vertx.core.Handler< io.vertx.grpc.GrpcBidiExchange<io.vertx.tp.ipc.eon.StreamServerResponse, io.vertx.tp.ipc.eon.StreamClientRequest>> handler) { final io.vertx.grpc.GrpcReadStream<io.vertx.tp.ipc.eon.StreamServerResponse> readStream = io.vertx.grpc.GrpcReadStream.<io.vertx.tp.ipc.eon.StreamServerResponse>create(); handler.handle(io.vertx.grpc.GrpcBidiExchange.create(readStream, asyncBidiStreamingCall( getChannel().newCall(METHOD_DUPLIEX_CALL, getCallOptions()), readStream.readObserver()))); } }
/** * <pre> * Client -> Server * </pre> */ public void inputCall(io.vertx.core.Handler< io.vertx.grpc.GrpcBidiExchange<io.vertx.tp.ipc.eon.StreamClientResponse, io.vertx.tp.ipc.eon.StreamClientRequest>> handler) { final io.vertx.grpc.GrpcReadStream<io.vertx.tp.ipc.eon.StreamClientResponse> readStream = io.vertx.grpc.GrpcReadStream.<io.vertx.tp.ipc.eon.StreamClientResponse>create(); handler.handle(io.vertx.grpc.GrpcBidiExchange.create(readStream, asyncBidiStreamingCall( getChannel().newCall(METHOD_INPUT_CALL, getCallOptions()), readStream.readObserver()))); } }
/** * <pre> * Server -> Client * </pre> */ public void outputCall(io.vertx.core.Handler< io.vertx.grpc.GrpcBidiExchange<io.vertx.tp.ipc.eon.StreamServerResponse, io.vertx.tp.ipc.eon.StreamServerRequest>> handler) { final io.vertx.grpc.GrpcReadStream<io.vertx.tp.ipc.eon.StreamServerResponse> readStream = io.vertx.grpc.GrpcReadStream.<io.vertx.tp.ipc.eon.StreamServerResponse>create(); handler.handle(io.vertx.grpc.GrpcBidiExchange.create(readStream, asyncBidiStreamingCall( getChannel().newCall(METHOD_OUTPUT_CALL, getCallOptions()), readStream.readObserver()))); } }
/** */ public void source(io.grpc.examples.streaming.Empty request, io.vertx.core.Handler<io.vertx.grpc.GrpcReadStream<io.grpc.examples.streaming.Item>> handler) { final io.vertx.grpc.GrpcReadStream<io.grpc.examples.streaming.Item> readStream = io.vertx.grpc.GrpcReadStream.<io.grpc.examples.streaming.Item>create(); handler.handle(readStream); asyncServerStreamingCall( getChannel().newCall(getSourceMethod(), getCallOptions()), request, readStream.readObserver()); }
/** * <pre> * One request followed by a sequence of responses (streamed download). * The server returns the payload with client desired type and sizes. * </pre> */ public void streamingOutputCall(io.grpc.testing.integration.Messages.StreamingOutputCallRequest request, io.vertx.core.Handler<io.vertx.grpc.GrpcReadStream<io.grpc.testing.integration.Messages.StreamingOutputCallResponse>> handler) { final io.vertx.grpc.GrpcReadStream<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> readStream = io.vertx.grpc.GrpcReadStream.<io.grpc.testing.integration.Messages.StreamingOutputCallResponse>create(); handler.handle(readStream); asyncServerStreamingCall( getChannel().newCall(getStreamingOutputCallMethod(), getCallOptions()), request, readStream.readObserver()); }
/** */ public void pipe(io.vertx.core.Handler< io.vertx.grpc.GrpcBidiExchange<io.grpc.examples.streaming.Item, io.grpc.examples.streaming.Item>> handler) { final io.vertx.grpc.GrpcReadStream<io.grpc.examples.streaming.Item> readStream = io.vertx.grpc.GrpcReadStream.<io.grpc.examples.streaming.Item>create(); handler.handle(io.vertx.grpc.GrpcBidiExchange.create(readStream, asyncBidiStreamingCall( getChannel().newCall(getPipeMethod(), getCallOptions()), readStream.readObserver()))); } }
/** */ public void sink(io.vertx.core.Handler< io.vertx.grpc.GrpcUniExchange<io.grpc.examples.streaming.Item, io.grpc.examples.streaming.Empty>> handler) { final io.vertx.grpc.GrpcReadStream<io.grpc.examples.streaming.Empty> readStream = io.vertx.grpc.GrpcReadStream.<io.grpc.examples.streaming.Empty>create(); handler.handle(io.vertx.grpc.GrpcUniExchange.create(readStream, asyncClientStreamingCall( getChannel().newCall(getSinkMethod(), getCallOptions()), readStream.readObserver()))); }
/** * <pre> * A sequence of requests followed by one response (streamed upload). * The server returns the aggregated size of client payload as the result. * </pre> */ public void streamingInputCall(io.vertx.core.Handler< io.vertx.grpc.GrpcUniExchange<io.grpc.testing.integration.Messages.StreamingInputCallRequest, io.grpc.testing.integration.Messages.StreamingInputCallResponse>> handler) { final io.vertx.grpc.GrpcReadStream<io.grpc.testing.integration.Messages.StreamingInputCallResponse> readStream = io.vertx.grpc.GrpcReadStream.<io.grpc.testing.integration.Messages.StreamingInputCallResponse>create(); handler.handle(io.vertx.grpc.GrpcUniExchange.create(readStream, asyncClientStreamingCall( getChannel().newCall(getStreamingInputCallMethod(), getCallOptions()), readStream.readObserver()))); }
/** * <pre> * A sequence of requests with each request served by the server immediately. * As one request could lead to multiple responses, this interface * demonstrates the idea of full duplexing. * </pre> */ public void fullDuplexCall(io.vertx.core.Handler< io.vertx.grpc.GrpcBidiExchange<io.grpc.testing.integration.Messages.StreamingOutputCallResponse, io.grpc.testing.integration.Messages.StreamingOutputCallRequest>> handler) { final io.vertx.grpc.GrpcReadStream<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> readStream = io.vertx.grpc.GrpcReadStream.<io.grpc.testing.integration.Messages.StreamingOutputCallResponse>create(); handler.handle(io.vertx.grpc.GrpcBidiExchange.create(readStream, asyncBidiStreamingCall( getChannel().newCall(getFullDuplexCallMethod(), getCallOptions()), readStream.readObserver()))); }
/** * <pre> * A sequence of requests followed by a sequence of responses. * The server buffers all the client requests and then serves them in order. A * stream of responses are returned to the client when the server starts with * first request. * </pre> */ public void halfDuplexCall(io.vertx.core.Handler< io.vertx.grpc.GrpcBidiExchange<io.grpc.testing.integration.Messages.StreamingOutputCallResponse, io.grpc.testing.integration.Messages.StreamingOutputCallRequest>> handler) { final io.vertx.grpc.GrpcReadStream<io.grpc.testing.integration.Messages.StreamingOutputCallResponse> readStream = io.vertx.grpc.GrpcReadStream.<io.grpc.testing.integration.Messages.StreamingOutputCallResponse>create(); handler.handle(io.vertx.grpc.GrpcBidiExchange.create(readStream, asyncBidiStreamingCall( getChannel().newCall(getHalfDuplexCallMethod(), getCallOptions()), readStream.readObserver()))); }