com.salesforce.reactivegrpc.jmh.proto.RxBenchmarkServiceGrpc Maven / Gradle / Ivy
package com.salesforce.reactivegrpc.jmh.proto;
import static com.salesforce.reactivegrpc.jmh.proto.BenchmarkServiceGrpc.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 RxBenchmarkServiceGrpc {
private RxBenchmarkServiceGrpc() {}
public static RxBenchmarkServiceStub newRxStub(io.grpc.Channel channel) {
return new RxBenchmarkServiceStub(channel);
}
public static final class RxBenchmarkServiceStub extends io.grpc.stub.AbstractStub {
private BenchmarkServiceGrpc.BenchmarkServiceStub delegateStub;
private RxBenchmarkServiceStub(io.grpc.Channel channel) {
super(channel);
delegateStub = BenchmarkServiceGrpc.newStub(channel);
}
private RxBenchmarkServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
delegateStub = BenchmarkServiceGrpc.newStub(channel).build(channel, callOptions);
}
@java.lang.Override
protected RxBenchmarkServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new RxBenchmarkServiceStub(channel, callOptions);
}
/**
*
* One request followed by one response.
* The server returns the client payload as-is.
*
*/
public io.reactivex.Single unaryCall(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.Messages.SimpleRequest request, io.grpc.stub.StreamObserver observer) {
delegateStub.unaryCall(request, observer);
}
});
}
/**
*
* Repeated sequence of one request followed by one response.
* Should be called streaming ping-pong
* The server returns the client payload as-is on each response
*
*/
public io.reactivex.Flowable streamingCall(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.streamingCall(observer);
}
});
}
/**
*
* Single-sided unbounded streaming from client to server
* The server returns the client payload as-is once the client does WritesDone
*
*/
public io.reactivex.Single streamingFromClient(io.reactivex.Flowable rxRequest) {
return com.salesforce.rxgrpc.stub.ClientCalls.manyToOne(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.streamingFromClient(observer);
}
});
}
/**
*
* Single-sided unbounded streaming from server to client
* The server repeatedly returns the client payload as-is
*
*/
public io.reactivex.Flowable streamingFromServer(io.reactivex.Single rxRequest) {
return com.salesforce.rxgrpc.stub.ClientCalls.oneToMany(rxRequest,
new com.salesforce.reactivegrpc.common.BiConsumer>() {
@java.lang.Override
public void accept(com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleRequest request, io.grpc.stub.StreamObserver observer) {
delegateStub.streamingFromServer(request, observer);
}
});
}
/**
*
* Two-sided unbounded streaming between server to client
* Both sides send the content of their own choice to the other
*
*/
public io.reactivex.Flowable streamingBothWays(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.streamingBothWays(observer);
}
});
}
/**
*
* One request followed by one response.
* The server returns the client payload as-is.
*
*/
public io.reactivex.Single unaryCall(com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleRequest 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.Messages.SimpleRequest request, io.grpc.stub.StreamObserver observer) {
delegateStub.unaryCall(request, observer);
}
});
}
/**
*
* Single-sided unbounded streaming from server to client
* The server repeatedly returns the client payload as-is
*
*/
public io.reactivex.Flowable streamingFromServer(com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleRequest rxRequest) {
return com.salesforce.rxgrpc.stub.ClientCalls.oneToMany(io.reactivex.Single.just(rxRequest),
new com.salesforce.reactivegrpc.common.BiConsumer>() {
@java.lang.Override
public void accept(com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleRequest request, io.grpc.stub.StreamObserver observer) {
delegateStub.streamingFromServer(request, observer);
}
});
}
}
public static abstract class BenchmarkServiceImplBase implements io.grpc.BindableService {
/**
*
* One request followed by one response.
* The server returns the client payload as-is.
*
*/
public io.reactivex.Single unaryCall(io.reactivex.Single request) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
/**
*
* Repeated sequence of one request followed by one response.
* Should be called streaming ping-pong
* The server returns the client payload as-is on each response
*
*/
public io.reactivex.Flowable streamingCall(io.reactivex.Flowable request) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
/**
*
* Single-sided unbounded streaming from client to server
* The server returns the client payload as-is once the client does WritesDone
*
*/
public io.reactivex.Single streamingFromClient(io.reactivex.Flowable request) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
/**
*
* Single-sided unbounded streaming from server to client
* The server repeatedly returns the client payload as-is
*
*/
public io.reactivex.Flowable streamingFromServer(io.reactivex.Single request) {
throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED);
}
/**
*
* Two-sided unbounded streaming between server to client
* Both sides send the content of their own choice to the other
*
*/
public io.reactivex.Flowable streamingBothWays(io.reactivex.Flowable 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.BenchmarkServiceGrpc.getUnaryCallMethod(),
asyncUnaryCall(
new MethodHandlers<
com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleRequest,
com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleResponse>(
this, METHODID_UNARY_CALL)))
.addMethod(
com.salesforce.reactivegrpc.jmh.proto.BenchmarkServiceGrpc.getStreamingCallMethod(),
asyncBidiStreamingCall(
new MethodHandlers<
com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleRequest,
com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleResponse>(
this, METHODID_STREAMING_CALL)))
.addMethod(
com.salesforce.reactivegrpc.jmh.proto.BenchmarkServiceGrpc.getStreamingFromClientMethod(),
asyncClientStreamingCall(
new MethodHandlers<
com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleRequest,
com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleResponse>(
this, METHODID_STREAMING_FROM_CLIENT)))
.addMethod(
com.salesforce.reactivegrpc.jmh.proto.BenchmarkServiceGrpc.getStreamingFromServerMethod(),
asyncServerStreamingCall(
new MethodHandlers<
com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleRequest,
com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleResponse>(
this, METHODID_STREAMING_FROM_SERVER)))
.addMethod(
com.salesforce.reactivegrpc.jmh.proto.BenchmarkServiceGrpc.getStreamingBothWaysMethod(),
asyncBidiStreamingCall(
new MethodHandlers<
com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleRequest,
com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleResponse>(
this, METHODID_STREAMING_BOTH_WAYS)))
.build();
}
}
private static final int METHODID_UNARY_CALL = 0;
private static final int METHODID_STREAMING_CALL = 1;
private static final int METHODID_STREAMING_FROM_CLIENT = 2;
private static final int METHODID_STREAMING_FROM_SERVER = 3;
private static final int METHODID_STREAMING_BOTH_WAYS = 4;
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 BenchmarkServiceImplBase serviceImpl;
private final int methodId;
MethodHandlers(BenchmarkServiceImplBase 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_UNARY_CALL:
com.salesforce.rxgrpc.stub.ServerCalls.oneToOne((com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleRequest) 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.unaryCall(single);
}
});
break;
case METHODID_STREAMING_FROM_SERVER:
com.salesforce.rxgrpc.stub.ServerCalls.oneToMany((com.salesforce.reactivegrpc.jmh.proto.Messages.SimpleRequest) request,
(io.grpc.stub.StreamObserver) responseObserver,
new com.salesforce.reactivegrpc.common.Function, io.reactivex.Flowable>() {
@java.lang.Override
public io.reactivex.Flowable apply(io.reactivex.Single single) {
return serviceImpl.streamingFromServer(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_STREAMING_CALL:
return (io.grpc.stub.StreamObserver) com.salesforce.rxgrpc.stub.ServerCalls.manyToMany(
(io.grpc.stub.StreamObserver) responseObserver,
serviceImpl::streamingCall);
case METHODID_STREAMING_FROM_CLIENT:
return (io.grpc.stub.StreamObserver) com.salesforce.rxgrpc.stub.ServerCalls.manyToOne(
(io.grpc.stub.StreamObserver) responseObserver,
serviceImpl::streamingFromClient);
case METHODID_STREAMING_BOTH_WAYS:
return (io.grpc.stub.StreamObserver) com.salesforce.rxgrpc.stub.ServerCalls.manyToMany(
(io.grpc.stub.StreamObserver) responseObserver,
serviceImpl::streamingBothWays);
default:
throw new java.lang.AssertionError();
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy