Package reactor.core

Interface Disposable

All Known Subinterfaces:
Disposable.Composite, Disposable.Swap, Scheduler, Scheduler.Worker
All Known Implementing Classes:
BaseSubscriber, DirectProcessor, EmitterProcessor, FluxProcessor, MonoProcessor, ReplayProcessor, Schedulers.Snapshot, UnicastProcessor
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Disposable
Indicates that a task or resource can be cancelled/disposed.

Call to the dispose method is/should be idempotent.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A container of Disposable that is itself Disposable.
    static interface 
    A Disposable container that allows updating/replacing its inner Disposable atomically and with respect of disposing the container itself.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cancel or dispose the underlying task or resource.
    default boolean
    Optionally return true when the resource or task is disposed.
  • Method Details

    • dispose

      void dispose()
      Cancel or dispose the underlying task or resource.

      Implementations are required to make this method idempotent.

    • isDisposed

      default boolean isDisposed()
      Optionally return true when the resource or task is disposed.

      Implementations are not required to track disposition and as such may never return true even when disposed. However, they MUST only return true when there's a guarantee the resource or task is disposed.

      Returns:
      true when there's a guarantee the resource or task is disposed.