Class ObservableCache.CacheDisposable<T>

java.lang.Object
java.lang.Number
java.util.concurrent.atomic.AtomicInteger
io.reactivex.rxjava3.internal.operators.observable.ObservableCache.CacheDisposable<T>
Type Parameters:
T - the value type
All Implemented Interfaces:
Disposable, Serializable
Enclosing class:
ObservableCache<T>

static final class ObservableCache.CacheDisposable<T> extends AtomicInteger implements Disposable
Hosts the downstream consumer and its current requested and replay states. this holds the work-in-progress counter for the serialized replay.
  • Field Details

  • Constructor Details

    • CacheDisposable

      CacheDisposable(Observer<? super T> downstream, ObservableCache<T> parent)
      Constructs a new instance with the actual downstream consumer and the parent cache object.
      Parameters:
      downstream - the actual consumer
      parent - the parent that holds onto the cached items
  • Method Details

    • dispose

      public void dispose()
      Description copied from interface: Disposable
      Dispose the resource, the operation should be idempotent.
      Specified by:
      dispose in interface Disposable
    • isDisposed

      public boolean isDisposed()
      Description copied from interface: Disposable
      Returns true if this resource has been disposed.
      Specified by:
      isDisposed in interface Disposable
      Returns:
      true if this resource has been disposed