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

## Interface Stage.FlatMap

All Superinterfaces:
  Stage

Enclosing interface:
  Stage

    public static interface Stage.FlatMap
    extends Stage

A flat map stage.

The flat map stage must execute the given mapper on each element, and concatenate the publishers emitted by the mapper function into the resulting stream.

The graph emitted by the mapper function is guaranteed to have an outlet but no inlet.

The engine must ensure only one publisher emitted by the mapper function is running at a time.

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 both the currently running inner publisher produced by the `mapper`, if one is currently running, and the outer upstream, must be cancelled.

If the inner publisher terminates with an error, the outer publisher 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 the outer publisher terminates with an error, then implementations may cancel the inner publisher, if one is currently running, immediately, or they may wait for the inner publisher to complete, before propagating 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 inner publisher is cancelled as soon as possible.

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

### Method Detail

#### getMapper

    Function<?,Graph> getMapper()

The mapper function.

Returns:
  The mapper function.