java.lang.Object
mutiny.zero.operators.Recover<T>
- Type Parameters:
T
- the elements type
- All Implemented Interfaces:
Flow.Publisher<T>
A
Flow.Publisher
that recovers from failure using a Function
.
The provided function accepts an error that would normally trigger an
Flow.Subscriber.onError(Throwable)
signal.
The function returns a recovery value of type T
, then the stream terminates with an
Flow.Subscriber.onComplete()
signal.
If the function returns null
then the stream terminates directly with a completion event.
The stream ends with an error if the function throws an exception.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Recover
Build a new recovery publisher.- Parameters:
upstream
- the upstream publisherfunction
- the recovery function, must not returnnull
values
-
-
Method Details
-
subscribe
- Specified by:
subscribe
in interfaceFlow.Publisher<T>
-