Interface Stage.FindFirst

All Superinterfaces:
Stage
Enclosing interface:
Stage

public static interface Stage.FindFirst extends Stage
A subscriber stage that emits the first element encountered.

When built, the CompletionStage must emit an Optional of the first element encountered. If no element is emitted before completion of the stream, it must emit an empty optional. Once the element has been emitted, the stream must be cancelled if not already complete.

If an error is emitted before the first element is encountered, the stream must redeem the completion stage with that error.