Class CancellableDisposable

java.lang.Object
java.util.concurrent.atomic.AtomicReference<Cancellable>
io.reactivex.rxjava3.internal.disposables.CancellableDisposable
All Implemented Interfaces:
Disposable, Serializable

public final class CancellableDisposable extends AtomicReference<Cancellable> implements Disposable
A disposable container that wraps a Cancellable instance.

Watch out for the AtomicReference API leak!

See Also:
  • Field Details

  • Constructor Details

    • CancellableDisposable

      public CancellableDisposable(Cancellable cancellable)
  • Method Details

    • 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
    • dispose

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