Provides several concurrency primitives.
Provides several concurrency primitives. *
Implementation of the reactive-streams protocol for fs2; based on Java Flow.
Implementation of the reactive-streams protocol for fs2; based on Java Flow.
All syntax has been moved directly onto Stream.
scala> import cats.effect.IO scala> import fs2.Stream scala> import java.util.concurrent.Flow.Publisher scala> scala> val upstream: Stream[IO, Int] = Stream(1, 2, 3).covary[IO] scala> val publisher: Stream[IO, Publisher[Int]] = upstream.toPublisher scala> val downstream: Stream[IO, Int] = publisher.flatMap { publisher => | Stream.fromPublisher[IO](publisher, chunkSize = 16) | } scala> scala> import cats.effect.unsafe.implicits.global scala> downstream.compile.toVector.unsafeRunSync() res0: Vector[Int] = Vector(1, 2, 3)