Class CancellablePublisher<T>

  • All Implemented Interfaces:
    org.reactivestreams.Publisher<T>

    public class CancellablePublisher<T>
    extends java.lang.Object
    implements org.reactivestreams.Publisher<T>
    Wrapped a source publisher and make it cancellable on demand. The cancellation happens if no-one subscribed to the source publisher. This class is required for the ConcatStageFactory to enforce the reactive streams rules.
    Author:
    Clement Escoffier
    • Constructor Summary

      Constructors 
      Constructor Description
      CancellablePublisher​(org.reactivestreams.Publisher<T> delegate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cancelIfNotSubscribed()  
      void subscribe​(org.reactivestreams.Subscriber<? super T> subscriber)  
      • Methods inherited from class java.lang.Object

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

      • CancellablePublisher

        public CancellablePublisher​(org.reactivestreams.Publisher<T> delegate)
    • Method Detail

      • subscribe

        public void subscribe​(org.reactivestreams.Subscriber<? super T> subscriber)
        Specified by:
        subscribe in interface org.reactivestreams.Publisher<T>
      • cancelIfNotSubscribed

        public void cancelIfNotSubscribed()