StreamConverters.asInputStream

Create a sink which materializes into an InputStream that can be read to trigger demand through the sink.

Additional Sink and Source converters

Signature

def asInputStream(readTimeout: FiniteDuration = 5.seconds): Sink[ByteString, InputStream]

Description

Create a sink which materializes into an InputStream that can be read to trigger demand through the sink. Bytes emitted through the stream will be available for reading through the InputStream

The InputStream will be ended when the stream flowing into this Sink completes, and the closing the InputStream will cancel the inflow of this Sink.

Reactive Streams semantics

cancels when the InputStream is closed

backpressures when no read is pending on the InputStream

Found an error in this documentation? The source code for this page can be found here. Please feel free to edit and contribute a pull request.