Interface Stage.OnTerminate
-
- All Superinterfaces:
Stage
- Enclosing interface:
- Stage
public static interface Stage.OnTerminate extends Stage
A stage returning a stream containing all the elements from this stream, additionally performing the provided action if this stream terminates with an error, completes, or is cancelled by downstream.The given action cannot determine in which state the stream is (error, completed or cancelled). Use
Stage.OnError
andStage.OnComplete
if you need to distinguish between these cases.The action must only be invoked once. If both upstream completes, and downstream cancels, at the same time, only one of those signals may trigger the invocation of action.
If this action is invoked as the result of an upstream completion or error, any
RuntimeException
thrown by the function must be propagated downstream as an error, replacing the exception that the consumer was handling. If the action is invoked as the result of downstream cancellation, then any exceptions thrown by the function must be ignored, and cancellation must be propagated upstream.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.microprofile.reactive.streams.operators.spi.Stage
Stage.Cancel, Stage.Collect, Stage.Concat, Stage.Coupled, Stage.Distinct, Stage.DropWhile, Stage.Failed, Stage.Filter, Stage.FindFirst, Stage.FlatMap, Stage.FlatMapCompletionStage, Stage.FlatMapIterable, Stage.FromCompletionStage, Stage.FromCompletionStageNullable, Stage.Limit, Stage.Map, Stage.Of, Stage.OnComplete, Stage.OnError, Stage.OnErrorResume, Stage.OnErrorResumeWith, Stage.OnTerminate, Stage.Peek, Stage.ProcessorStage, Stage.PublisherStage, Stage.Skip, Stage.SubscriberStage, Stage.TakeWhile
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Runnable
getAction()
The action to execute.
-