Class OnSubscribeFromCallable<T>

  • Type Parameters:
    T - the value type emitted
    All Implemented Interfaces:
    Action, Action1<Subscriber<? super T>>, Function, Observable.OnSubscribe<T>

    public final class OnSubscribeFromCallable<T>
    extends java.lang.Object
    implements Observable.OnSubscribe<T>
    Do not invoke the function until an Observer subscribes; Invokes function on each subscription.

    Pass fromCallable a function, and fromCallable will call this function to emit result of invocation afresh each time a new Observer subscribes.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.Callable<? extends T> resultFactory  
    • Constructor Summary

      Constructors 
      Constructor Description
      OnSubscribeFromCallable​(java.util.concurrent.Callable<? extends T> resultFactory)  
    • Method Summary

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

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

      • resultFactory

        private final java.util.concurrent.Callable<? extends T> resultFactory
    • Constructor Detail

      • OnSubscribeFromCallable

        public OnSubscribeFromCallable​(java.util.concurrent.Callable<? extends T> resultFactory)