Class GrpcGraphUtil
- java.lang.Object
-
- org.curioswitch.common.server.framework.grpc.GrpcGraphUtil
-
public final class GrpcGraphUtil extends java.lang.Object
A 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 aListenableFuture
to the response handling methods of aStreamObserver
for 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.UseBindsInstance
instead of passing theProducerModule
into 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 aListenableFuture
to the response handling methods of aStreamObserver
for 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 aListenableFuture
to the response handling methods of aStreamObserver
for aGrpcProductionComponent
which 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.UseBindsInstance
instead of passing theProducerModule
into the component. All modules should be abstract.Invokes a unaryGrpcProductionComponent
with the provided request and graph factory.
-
-