NestedStreamOps

final implicit
class NestedStreamOps[F[_], O](outer: Stream[F, Stream[F, O]]) extends AnyVal

Provides syntax for streams of streams.

class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def parJoin(maxOpen: Int)(implicit F: Concurrent[F]): Stream[F, O]

Nondeterministically merges a stream of streams (outer) in to a single stream, opening at most maxOpen streams at any point in time.

Nondeterministically merges a stream of streams (outer) in to a single stream, opening at most maxOpen streams at any point in time.

The outer stream is evaluated and each resulting inner stream is run concurrently, up to maxOpen stream. Once this limit is reached, evaluation of the outer stream is paused until one or more inner streams finish evaluating.

When the outer stream stops gracefully, all inner streams continue to run, resulting in a stream that will stop when all inner streams finish their evaluation.

When the outer stream fails, evaluation of all inner streams is interrupted and the resulting stream will fail with same failure.

When any of the inner streams fail, then the outer stream and all other inner streams are interrupted, resulting in stream that fails with the error of the stream that caused initial failure.

Finalizers on each inner stream are run at the end of the inner stream, concurrently with other stream computations.

Finalizers on the outer stream are run after all inner streams have been pulled from the outer stream but not before all inner streams terminate -- hence finalizers on the outer stream will run AFTER the LAST finalizer on the very last inner stream.

Finalizers on the returned stream are run after the outer stream has finished and all open inner streams have finished.

Value Params
maxOpen

Maximum number of open inner streams at any time. Must be > 0.

def parJoinUnbounded(implicit F: Concurrent[F]): Stream[F, O]

Like parJoin but races all inner streams simultaneously.

Like parJoin but races all inner streams simultaneously.