Package reactor.core
Class Disposables
java.lang.Object
reactor.core.Disposables
A support class that offers factory methods for implementations of the specialized
Disposable sub-interfaces (Disposable.Composite,
Disposable.Swap).- Author:
- Simon Baslé, Stephane Maldini
-
Method Summary
Modifier and TypeMethodDescriptionstatic Disposable.CompositeCreate a new emptyDisposable.Compositewith atomic guarantees on all mutative operations.static Disposable.Compositecomposite(Iterable<? extends Disposable> disposables) Create and initialize a newDisposable.Compositewith atomic guarantees on all mutative operations.static Disposable.Compositecomposite(Disposable... disposables) Create and initialize a newDisposable.Compositewith atomic guarantees on all mutative operations.static Disposabledisposed()Return a newDisposablethat is already disposed.static Disposablenever()Return a newDisposablethat can never be disposed.static Disposablesingle()Return a new simpleDisposableinstance that is initially not disposed but can be by callingDisposable.dispose().static Disposable.Swapswap()Create a new emptyDisposable.Swapwith atomic guarantees on all mutative operations.
-
Method Details
-
composite
Create a new emptyDisposable.Compositewith atomic guarantees on all mutative operations.- Returns:
- an empty atomic
Disposable.Composite
-
composite
Create and initialize a newDisposable.Compositewith atomic guarantees on all mutative operations.- Returns:
- a pre-filled atomic
Disposable.Composite
-
composite
Create and initialize a newDisposable.Compositewith atomic guarantees on all mutative operations.- Returns:
- a pre-filled atomic
Disposable.Composite
-
disposed
Return a newDisposablethat is already disposed.- Returns:
- a new disposed
Disposable.
-
never
Return a newDisposablethat can never be disposed. CallingDisposable.dispose()is a NO-OP andDisposable.isDisposed()always return false.- Returns:
- a new
Disposablethat can never be disposed.
-
single
Return a new simpleDisposableinstance that is initially not disposed but can be by callingDisposable.dispose().- Returns:
- a new
Disposableinitially not yet disposed.
-
swap
Create a new emptyDisposable.Swapwith atomic guarantees on all mutative operations.- Returns:
- an empty atomic
Disposable.Swap
-