Class 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>
      void
      unary​(com.google.common.util.concurrent.ListenableFuture<Resp> responseFuture, io.grpc.stub.StreamObserver<Resp> observer)
      Wires the result of a ListenableFuture to the response handling methods of a StreamObserver for a unary RPC.
      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.
      Use BindsInstance instead of passing the ProducerModule into the component.
      static <Resp extends com.google.protobuf.Message,​C extends GrpcProductionComponent<Resp>>
      void
      unary​(io.grpc.stub.StreamObserver<Resp> observer, javax.inject.Provider<C> component)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 a ListenableFuture to the response handling methods of a StreamObserver 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.
        Use unary(ListenableFuture, StreamObserver). The boilerplate removal of .get().execute() is not worth having to implement interfaces.
        Wires the result of a ListenableFuture to the response handling methods of a StreamObserver for a GrpcProductionComponent 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.
        Use BindsInstance instead of passing the ProducerModule into the component. All modules should be abstract.
        Invokes a unary GrpcProductionComponent with the provided request and graph factory.