public static interface Stage.FlatMapCompletionStage extends Stage
CompletionStage
.
The flat map stage must execute the given mapper on each element, and concatenate the values redeemed by the
CompletionStage
's emitted by the mapper function into the resulting stream.
The engine must ensure only one mapper function is executed at a time, with the next mapper function not
executing until the CompletionStage
returned by the previous mapper function has been redeemed.
Any RuntimeException
thrown by the function must be propagated downstream as an error, and upstream
must be cancelled. Any subsequent elements received from upstream before the cancellation signal is handled
must be dropped.
If downstream cancels, then upstream must be cancelled, and if there is a currently executing
CompletionStage
, its result must be ignored.
If a CompletionStage
is redeemed with an error, upstream must be cancelled, and the error must be
propagated downstream. Any subsequent elements received from upstream before the cancellation signal is handled
must be dropped.
If upstream terminates with an error, then implementations may decide to ignore the result of any currently
executing CompletionStage
, and propagate the error immediately, or they may wait for the
CompletionStage
to be redeemed, emit its result, and then propagate the error downstream. For the
purpose of failing fast, so that network failures can be detected and handled, it is recommended, but not
required, that the failure is propagated downstream as soon as possible, and the result of the
CompletionStage
ignored.
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
Modifier and Type | Method and Description |
---|---|
Function<?,CompletionStage<?>> |
getMapper()
The mapper function.
|
Function<?,CompletionStage<?>> getMapper()
Copyright © 2019 Eclipse Foundation. All rights reserved.