Package reactor.core

Interface Disposable.Swap

All Superinterfaces:
Disposable, Supplier<Disposable>
Enclosing interface:
Disposable

public static interface Disposable.Swap extends Disposable, Supplier<Disposable>
A Disposable container that allows updating/replacing its inner Disposable atomically and with respect of disposing the container itself.
Author:
Simon Baslé
  • Method Details

    • update

      boolean update(@Nullable Disposable next)
      Atomically set the next Disposable on this container and dispose the previous one (if any). If the container has been disposed, fall back to disposing next.
      Parameters:
      next - the Disposable to set, may be null
      Returns:
      true if the operation succeeded, false if the container has been disposed
      See Also:
    • replace

      boolean replace(@Nullable Disposable next)
      Atomically set the next Disposable on this container but don't dispose the previous one (if any). If the container has been disposed, fall back to disposing next.
      Parameters:
      next - the Disposable to set, may be null
      Returns:
      true if the operation succeeded, false if the container has been disposed
      See Also: