org.eclipse.microprofile.reactive.streams.operators.spi

## Interface Stage.FlatMapCompletionStage

All Superinterfaces:
  Stage

Enclosing interface:
  Stage

    public static interface Stage.FlatMapCompletionStage
    extends Stage

A flat map stage that emits and flattens `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. If the value is `null`, then no element must be emitted, and the stream should be failed with a `NullPointerException`.

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.

### 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
`Function<?,CompletionStage<?>>` `getMapper()` The mapper function.

### Method Detail

#### getMapper

    Function<?,CompletionStage<?>> getMapper()

The mapper function.

Returns:
  The mapper function.