Sink.futureSink

Streams the elements to the given future sink once it successfully completes.

Sink operators

Signature

Sink.futureSinkSink.futureSink

Description

Streams the elements through the given future flow once it successfully completes. If the future fails the stream is failed.

futureSink uses the same lazy materialization semantics as lazyFutureSink: the nested sink is not materialized until the first upstream element arrives. If the stream completes before the first element, the materialized value fails with org.apache.pekko.stream.NeverMaterializedException.

If you want this to work for empty streams as well, use eagerFutureSink.

Reactive Streams semantics

cancels if the future fails or if the created sink cancels

backpressures when initialized and when created sink backpressures