Class OperatorSampleWithTime.SamplerSubscriber<T>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.Object EMPTY_TOKEN
      Indicates that no value is available.
      private Subscriber<? super T> subscriber  
      (package private) java.util.concurrent.atomic.AtomicReference<java.lang.Object> value
      The shared value between the observer and the timed action.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void call()  
      private void emitIfNonEmpty()  
      void onCompleted()
      Notifies the Observer that the Observable has finished sending push-based notifications.
      void onError​(java.lang.Throwable e)
      Notifies the Observer that the Observable has experienced an error condition.
      void onNext​(T t)
      Provides the Observer with a new item to observe.
      void onStart()
      This method is invoked when the Subscriber and Observable have been connected but the Observable has not yet begun to emit items or send notifications to the Subscriber.
      • Methods inherited from class java.lang.Object

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

      • subscriber

        private final Subscriber<? super T> subscriber
      • EMPTY_TOKEN

        private static final java.lang.Object EMPTY_TOKEN
        Indicates that no value is available.
      • value

        final java.util.concurrent.atomic.AtomicReference<java.lang.Object> value
        The shared value between the observer and the timed action.
    • Constructor Detail

      • SamplerSubscriber

        public SamplerSubscriber​(Subscriber<? super T> subscriber)
    • Method Detail

      • onStart

        public void onStart()
        Description copied from class: Subscriber
        This method is invoked when the Subscriber and Observable have been connected but the Observable has not yet begun to emit items or send notifications to the Subscriber. Override this method to add any useful initialization to your subscription, for instance to initiate backpressure.
        Overrides:
        onStart in class Subscriber<T>
      • call

        public void call()
        Specified by:
        call in interface Action0
      • emitIfNonEmpty

        private void emitIfNonEmpty()