Class OperatorReplay<T>

java.lang.Object
rx.Observable<T>
rx.observables.ConnectableObservable<T>
rx.internal.operators.OperatorReplay<T>

public final class OperatorReplay<T> extends ConnectableObservable<T>
  • Field Details

  • Constructor Details

  • Method Details

    • multicastSelector

      public static <T, U, R> Observable<R> multicastSelector(Func0<? extends ConnectableObservable<U>> connectableFactory, Func1<? super Observable<U>,? extends Observable<R>> selector)
      Given a connectable observable factory, it multicasts over the generated ConnectableObservable via a selector function.
      Type Parameters:
      T - the upstream's value type
      U - the intermediate value type of the ConnectableObservable
      R - the final value type provided by the selector function
      Parameters:
      connectableFactory - the factory that returns a ConnectableObservable instance
      selector - the function applied on the ConnectableObservable and returns the Observable the downstream will subscribe to.
      Returns:
      the Observable multicasting over a transformation of a ConnectableObserable
    • observeOn

      public static <T> ConnectableObservable<T> observeOn(ConnectableObservable<T> co, Scheduler scheduler)
      Child Subscribers will observe the events of the ConnectableObservable on the specified scheduler.
      Type Parameters:
      T - the value type
      Parameters:
      co - the ConnectableObservable to schedule on the specified scheduler
      scheduler - the target Scheduler instance
      Returns:
      the ConnectableObservable instance that is observed on the specified scheduler
    • create

      public static <T> ConnectableObservable<T> create(Observable<? extends T> source)
      Creates a replaying ConnectableObservable with an unbounded buffer.
      Type Parameters:
      T - the value type
      Parameters:
      source - the source Observable
      Returns:
      the replaying ConnectableObservable
    • create

      public static <T> ConnectableObservable<T> create(Observable<? extends T> source, int bufferSize)
      Creates a replaying ConnectableObservable with a size bound buffer.
      Type Parameters:
      T - the value type
      Parameters:
      source - the source Observable
      bufferSize - the maximum number of elements buffered
      Returns:
      the replaying ConnectableObservable
    • create

      public static <T> ConnectableObservable<T> create(Observable<? extends T> source, long maxAge, TimeUnit unit, Scheduler scheduler)
      Creates a replaying ConnectableObservable with a time bound buffer.
      Type Parameters:
      T - the value type
      Parameters:
      source - the source Observable
      maxAge - the maximum age (exclusive) of each item when timestamped with the given scheduler
      unit - the time unit of the maximum age
      scheduler - the scheduler providing the notion of current time
      Returns:
      the replaying ConnectableObservable
    • create

      public static <T> ConnectableObservable<T> create(Observable<? extends T> source, long maxAge, TimeUnit unit, Scheduler scheduler, int bufferSize)
      Creates a replaying ConnectableObservable with a size and time bound buffer.
      Type Parameters:
      T - the value type
      Parameters:
      source - the source Observable
      maxAge - the maximum age (exclusive) of each item when timestamped with the given scheduler
      unit - the time unit of the maximum age
      scheduler - the scheduler providing the notion of current time
      bufferSize - the maximum number of elements buffered
      Returns:
      the replaying ConnectableObservable
    • create

      static <T> ConnectableObservable<T> create(Observable<? extends T> source, Func0<? extends OperatorReplay.ReplayBuffer<T>> bufferFactory)
      Creates a OperatorReplay instance to replay values of the given source observable.
      Parameters:
      source - the source observable
      bufferFactory - the factory to instantiate the appropriate buffer when the observable becomes active
      Returns:
      the connectable observable
    • connect

      public void connect(Action1<? super Subscription> connection)
      Description copied from class: ConnectableObservable
      Instructs the ConnectableObservable to begin emitting the items from its underlying Observable to its Subscribers.
      Specified by:
      connect in class ConnectableObservable<T>
      Parameters:
      connection - the action that receives the connection subscription before the subscription to source happens allowing the caller to synchronously disconnect a synchronous source
      See Also: