Class ClientPublisher<Req,​Resp>

  • Type Parameters:
    Req - The request type of gRPC call.
    Resp - The response type of the gRPC call.
    All Implemented Interfaces:
    org.reactivestreams.Publisher<Resp>

    public class ClientPublisher<Req,​Resp>
    extends java.lang.Object
    implements org.reactivestreams.Publisher<Resp>
    RS-gRPC bridge component for server streaming. Defers execution of the RPC call until a subscription is made. Supports multiple subscribers. Each subscription will trigger executing the same RPC call.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void subscribe​(org.reactivestreams.Subscriber<? super Resp> subscriber)
      Executes the RPC call right away and feeds its results to the subscriber on demand.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClientPublisher

        public ClientPublisher​(@Nonnull
                               Req request,
                               @Nonnull
                               java.util.function.BiConsumer<Req,​io.grpc.stub.StreamObserver<Resp>> clientStub,
                               @Nonnull
                               ExecutionSequencerFactory esf)
    • Method Detail

      • subscribe

        public void subscribe​(org.reactivestreams.Subscriber<? super Resp> subscriber)
        Executes the RPC call right away and feeds its results to the subscriber on demand.
        Specified by:
        subscribe in interface org.reactivestreams.Publisher<Req>
        Parameters:
        subscriber - The target subscriber.