Class GrpcGraphUtil
- java.lang.Object
-
- org.curioswitch.common.server.framework.grpc.GrpcGraphUtil
-
public final class GrpcGraphUtil extends java.lang.ObjectA utility for using gRPC with producer graphs.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <Resp extends com.google.protobuf.Message>
voidunary(com.google.common.util.concurrent.ListenableFuture<Resp> responseFuture, io.grpc.stub.StreamObserver<Resp> observer)Wires the result of aListenableFutureto the response handling methods of aStreamObserverfor a unary RPC.static <G,Resp extends com.google.protobuf.Message,C extends GrpcProductionComponent<Resp>,B extends GrpcProductionComponent.GrpcProductionComponentBuilder<G,C,B>>
voidunary(G graph, io.grpc.stub.StreamObserver<Resp> observer, javax.inject.Provider<B> componentBuilder)Deprecated.UseBindsInstanceinstead of passing theProducerModuleinto the component.static <Resp extends com.google.protobuf.Message,C extends GrpcProductionComponent<Resp>>
voidunary(io.grpc.stub.StreamObserver<Resp> observer, javax.inject.Provider<C> component)Deprecated.
-
-
-
Method Detail
-
unary
public static <Resp extends com.google.protobuf.Message> void unary(com.google.common.util.concurrent.ListenableFuture<Resp> responseFuture, io.grpc.stub.StreamObserver<Resp> observer)Wires the result of aListenableFutureto the response handling methods of aStreamObserverfor a unary RPC.
-
unary
@Deprecated public static <Resp extends com.google.protobuf.Message,C extends GrpcProductionComponent<Resp>> void unary(io.grpc.stub.StreamObserver<Resp> observer, javax.inject.Provider<C> component)
Deprecated.Useunary(ListenableFuture, StreamObserver). The boilerplate removal of.get().execute()is not worth having to implement interfaces.Wires the result of aListenableFutureto the response handling methods of aStreamObserverfor aGrpcProductionComponentwhich takes no arguments.
-
unary
@Deprecated public static <G,Resp extends com.google.protobuf.Message,C extends GrpcProductionComponent<Resp>,B extends GrpcProductionComponent.GrpcProductionComponentBuilder<G,C,B>> void unary(G graph, io.grpc.stub.StreamObserver<Resp> observer, javax.inject.Provider<B> componentBuilder)
Deprecated.UseBindsInstanceinstead of passing theProducerModuleinto the component. All modules should be abstract.Invokes a unaryGrpcProductionComponentwith the provided request and graph factory.
-
-