All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.salesforce.reactivegrpc.jmh.proto.RxWorkerServiceGrpc Maven / Gradle / Ivy

package com.salesforce.reactivegrpc.jmh.proto;

import static com.salesforce.reactivegrpc.jmh.proto.WorkerServiceGrpc.getServiceDescriptor;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;


@javax.annotation.Generated(
value = "by RxGrpc generator",
comments = "Source: grpc/testing/services.proto")
public final class RxWorkerServiceGrpc {
    private RxWorkerServiceGrpc() {}

    public static RxWorkerServiceStub newRxStub(io.grpc.Channel channel) {
        return new RxWorkerServiceStub(channel);
    }

    public static final class RxWorkerServiceStub extends io.grpc.stub.AbstractStub {
        private WorkerServiceGrpc.WorkerServiceStub delegateStub;

        private RxWorkerServiceStub(io.grpc.Channel channel) {
            super(channel);
            delegateStub = WorkerServiceGrpc.newStub(channel);
        }

        private RxWorkerServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
            super(channel, callOptions);
            delegateStub = WorkerServiceGrpc.newStub(channel).build(channel, callOptions);
        }

        @java.lang.Override
        protected RxWorkerServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
            return new RxWorkerServiceStub(channel, callOptions);
        }

        /**
         * 
         *  Start server with specified workload.
         *  First request sent specifies the ServerConfig followed by ServerStatus
         *  response. After that, a "Mark" can be sent anytime to request the latest
         *  stats. Closing the stream will initiate shutdown of the test server
         *  and once the shutdown has finished, the OK status is sent to terminate
         *  this RPC.
         * 
*/ public io.reactivex.Flowable runServer(io.reactivex.Flowable rxRequest) { return com.salesforce.rxgrpc.stub.ClientCalls.manyToMany(rxRequest, new com.salesforce.reactivegrpc.common.Function, io.grpc.stub.StreamObserver>() { @java.lang.Override public io.grpc.stub.StreamObserver apply(io.grpc.stub.StreamObserver observer) { return delegateStub.runServer(observer); } }); } /** *
         *  Start client with specified workload.
         *  First request sent specifies the ClientConfig followed by ClientStatus
         *  response. After that, a "Mark" can be sent anytime to request the latest
         *  stats. Closing the stream will initiate shutdown of the test client
         *  and once the shutdown has finished, the OK status is sent to terminate
         *  this RPC.
         * 
*/ public io.reactivex.Flowable runClient(io.reactivex.Flowable rxRequest) { return com.salesforce.rxgrpc.stub.ClientCalls.manyToMany(rxRequest, new com.salesforce.reactivegrpc.common.Function, io.grpc.stub.StreamObserver>() { @java.lang.Override public io.grpc.stub.StreamObserver apply(io.grpc.stub.StreamObserver observer) { return delegateStub.runClient(observer); } }); } /** *
         *  Just return the core count - unary call
         * 
*/ public io.reactivex.Single coreCount(io.reactivex.Single rxRequest) { return com.salesforce.rxgrpc.stub.ClientCalls.oneToOne(rxRequest, new com.salesforce.reactivegrpc.common.BiConsumer>() { @java.lang.Override public void accept(com.salesforce.reactivegrpc.jmh.proto.Control.CoreRequest request, io.grpc.stub.StreamObserver observer) { delegateStub.coreCount(request, observer); } }); } /** *
         *  Quit this worker
         * 
*/ public io.reactivex.Single quitWorker(io.reactivex.Single rxRequest) { return com.salesforce.rxgrpc.stub.ClientCalls.oneToOne(rxRequest, new com.salesforce.reactivegrpc.common.BiConsumer>() { @java.lang.Override public void accept(com.salesforce.reactivegrpc.jmh.proto.Control.Void request, io.grpc.stub.StreamObserver observer) { delegateStub.quitWorker(request, observer); } }); } /** *
         *  Just return the core count - unary call
         * 
*/ public io.reactivex.Single coreCount(com.salesforce.reactivegrpc.jmh.proto.Control.CoreRequest rxRequest) { return com.salesforce.rxgrpc.stub.ClientCalls.oneToOne(io.reactivex.Single.just(rxRequest), new com.salesforce.reactivegrpc.common.BiConsumer>() { @java.lang.Override public void accept(com.salesforce.reactivegrpc.jmh.proto.Control.CoreRequest request, io.grpc.stub.StreamObserver observer) { delegateStub.coreCount(request, observer); } }); } /** *
         *  Quit this worker
         * 
*/ public io.reactivex.Single quitWorker(com.salesforce.reactivegrpc.jmh.proto.Control.Void rxRequest) { return com.salesforce.rxgrpc.stub.ClientCalls.oneToOne(io.reactivex.Single.just(rxRequest), new com.salesforce.reactivegrpc.common.BiConsumer>() { @java.lang.Override public void accept(com.salesforce.reactivegrpc.jmh.proto.Control.Void request, io.grpc.stub.StreamObserver observer) { delegateStub.quitWorker(request, observer); } }); } } public static abstract class WorkerServiceImplBase implements io.grpc.BindableService { /** *
         *  Start server with specified workload.
         *  First request sent specifies the ServerConfig followed by ServerStatus
         *  response. After that, a "Mark" can be sent anytime to request the latest
         *  stats. Closing the stream will initiate shutdown of the test server
         *  and once the shutdown has finished, the OK status is sent to terminate
         *  this RPC.
         * 
*/ public io.reactivex.Flowable runServer(io.reactivex.Flowable request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } /** *
         *  Start client with specified workload.
         *  First request sent specifies the ClientConfig followed by ClientStatus
         *  response. After that, a "Mark" can be sent anytime to request the latest
         *  stats. Closing the stream will initiate shutdown of the test client
         *  and once the shutdown has finished, the OK status is sent to terminate
         *  this RPC.
         * 
*/ public io.reactivex.Flowable runClient(io.reactivex.Flowable request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } /** *
         *  Just return the core count - unary call
         * 
*/ public io.reactivex.Single coreCount(io.reactivex.Single request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } /** *
         *  Quit this worker
         * 
*/ public io.reactivex.Single quitWorker(io.reactivex.Single request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( com.salesforce.reactivegrpc.jmh.proto.WorkerServiceGrpc.getRunServerMethod(), asyncBidiStreamingCall( new MethodHandlers< com.salesforce.reactivegrpc.jmh.proto.Control.ServerArgs, com.salesforce.reactivegrpc.jmh.proto.Control.ServerStatus>( this, METHODID_RUN_SERVER))) .addMethod( com.salesforce.reactivegrpc.jmh.proto.WorkerServiceGrpc.getRunClientMethod(), asyncBidiStreamingCall( new MethodHandlers< com.salesforce.reactivegrpc.jmh.proto.Control.ClientArgs, com.salesforce.reactivegrpc.jmh.proto.Control.ClientStatus>( this, METHODID_RUN_CLIENT))) .addMethod( com.salesforce.reactivegrpc.jmh.proto.WorkerServiceGrpc.getCoreCountMethod(), asyncUnaryCall( new MethodHandlers< com.salesforce.reactivegrpc.jmh.proto.Control.CoreRequest, com.salesforce.reactivegrpc.jmh.proto.Control.CoreResponse>( this, METHODID_CORE_COUNT))) .addMethod( com.salesforce.reactivegrpc.jmh.proto.WorkerServiceGrpc.getQuitWorkerMethod(), asyncUnaryCall( new MethodHandlers< com.salesforce.reactivegrpc.jmh.proto.Control.Void, com.salesforce.reactivegrpc.jmh.proto.Control.Void>( this, METHODID_QUIT_WORKER))) .build(); } } private static final int METHODID_RUN_SERVER = 0; private static final int METHODID_RUN_CLIENT = 1; private static final int METHODID_CORE_COUNT = 2; private static final int METHODID_QUIT_WORKER = 3; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { private final WorkerServiceImplBase serviceImpl; private final int methodId; MethodHandlers(WorkerServiceImplBase serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { case METHODID_CORE_COUNT: com.salesforce.rxgrpc.stub.ServerCalls.oneToOne((com.salesforce.reactivegrpc.jmh.proto.Control.CoreRequest) request, (io.grpc.stub.StreamObserver) responseObserver, new com.salesforce.reactivegrpc.common.Function, io.reactivex.Single>() { @java.lang.Override public io.reactivex.Single apply(io.reactivex.Single single) { return serviceImpl.coreCount(single); } }); break; case METHODID_QUIT_WORKER: com.salesforce.rxgrpc.stub.ServerCalls.oneToOne((com.salesforce.reactivegrpc.jmh.proto.Control.Void) request, (io.grpc.stub.StreamObserver) responseObserver, new com.salesforce.reactivegrpc.common.Function, io.reactivex.Single>() { @java.lang.Override public io.reactivex.Single apply(io.reactivex.Single single) { return serviceImpl.quitWorker(single); } }); break; default: throw new java.lang.AssertionError(); } } @java.lang.Override @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver invoke(io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { case METHODID_RUN_SERVER: return (io.grpc.stub.StreamObserver) com.salesforce.rxgrpc.stub.ServerCalls.manyToMany( (io.grpc.stub.StreamObserver) responseObserver, serviceImpl::runServer); case METHODID_RUN_CLIENT: return (io.grpc.stub.StreamObserver) com.salesforce.rxgrpc.stub.ServerCalls.manyToMany( (io.grpc.stub.StreamObserver) responseObserver, serviceImpl::runClient); default: throw new java.lang.AssertionError(); } } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy