Class ScheduledRunnable

java.lang.Object
java.util.concurrent.atomic.AtomicReferenceArray<Object>
io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable
All Implemented Interfaces:
Disposable, Serializable, Runnable, Callable<Object>

public final class ScheduledRunnable extends AtomicReferenceArray<Object> implements Runnable, Callable<Object>, Disposable
See Also:
  • Constructor Details

    • ScheduledRunnable

      public ScheduledRunnable(Runnable actual, DisposableContainer parent)
      Creates a ScheduledRunnable by wrapping the given action and setting up the optional parent. The underlying future will be interrupted if the task is disposed asynchronously.
      Parameters:
      actual - the runnable to wrap, not-null (not verified)
      parent - the parent tracking container or null if none
    • ScheduledRunnable

      public ScheduledRunnable(Runnable actual, DisposableContainer parent, boolean interruptOnCancel)
      Creates a ScheduledRunnable by wrapping the given action and setting up the optional parent.
      Parameters:
      actual - the runnable to wrap, not-null (not verified)
      parent - the parent tracking container or null if none
      interruptOnCancel - if true, the underlying future will be interrupted when disposing this task from a different thread than it is running on.
  • Method Details

    • call

      public Object call()
      Specified by:
      call in interface Callable<Object>
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • setFuture

      public void setFuture(Future<?> f)
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class AtomicReferenceArray<Object>