Package reactor.core
Interface Disposable.Swap
- All Superinterfaces:
Disposable,Supplier<Disposable>
- Enclosing interface:
- Disposable
A
Disposable container that allows updating/replacing its inner Disposable
atomically and with respect of disposing the container itself.- Author:
- Simon Baslé
-
Nested Class Summary
Nested classes/interfaces inherited from interface reactor.core.Disposable
Disposable.Composite, Disposable.Swap -
Method Summary
Modifier and TypeMethodDescriptionbooleanreplace(@Nullable Disposable next) Atomically set the nextDisposableon this container but don't dispose the previous one (if any).booleanupdate(@Nullable Disposable next) Atomically set the nextDisposableon this container and dispose the previous one (if any).Methods inherited from interface reactor.core.Disposable
dispose, isDisposed
-
Method Details
-
update
Atomically set the nextDisposableon this container and dispose the previous one (if any). If the container has been disposed, fall back to disposingnext.- Parameters:
next- theDisposableto set, may be null- Returns:
- true if the operation succeeded, false if the container has been disposed
- See Also:
-
replace
Atomically set the nextDisposableon this container but don't dispose the previous one (if any). If the container has been disposed, fall back to disposingnext.- Parameters:
next- theDisposableto set, may be null- Returns:
- true if the operation succeeded, false if the container has been disposed
- See Also:
-