Class CachedObservable<T>

  • Type Parameters:
    T - the source element type


    public final class CachedObservable<T>
    extends Observable<T>
    An observable which auto-connects to another observable, caches the elements from that observable but allows terminating the connection and completing the cache.
    • Method Detail

      • from

        public static <T> CachedObservable<T> from(Observable<? extends T> source)
        Creates a cached Observable with a default capacity hint of 16.
        Parameters:
        source - the source Observable to cache
        Returns:
        the CachedObservable instance
      • from

        public static <T> CachedObservable<T> from(Observable<? extends T> source,
                                                   int capacityHint)
        Creates a cached Observable with the given capacity hint.
        Parameters:
        source - the source Observable to cache
        capacityHint - the hint for the internal buffer size
        Returns:
        the CachedObservable instance