InvariantOps
Provides syntax for streams that are invariant in F
and O
.
Provides syntax for streams that are invariant in F
and O
.
Value members
Concrete methods
Lifts this stream to the specified effect type.
Lifts this stream to the specified effect type.
- Example
scala> import cats.effect.IO scala> Stream(1, 2, 3).covary[IO] res0: Stream[IO,Int] = Stream(..)
Synchronously sends values through p
.
Synchronously sends values through p
.
If p
fails, then resulting stream will fail. If p
halts the evaluation will halt too.
Note that observe will only output full chunks of O
that are known to be successfully processed
by p
. So if p
terminates/fails in the middle of chunk processing, the chunk will not be available
in resulting stream.
Note that if your pipe can be represented by an O => F[Unit]
, evalTap
will provide much greater performance.
- Example
scala> import cats.effect.IO, cats.effect.unsafe.implicits.global scala> Stream(1, 2, 3).covary[IO].observe(_.printlns).map(_ + 1).compile.toVector.unsafeRunSync() res0: Vector[Int] = Vector(2, 3, 4)
Send chunks through p
, allowing up to maxQueued
pending chunks before blocking s
.
Send chunks through p
, allowing up to maxQueued
pending chunks before blocking s
.
Observes this stream of Either[L, R]
values with two pipes, one that
observes left values and another that observes right values.
Observes this stream of Either[L, R]
values with two pipes, one that
observes left values and another that observes right values.
If either of left
or right
fails, then resulting stream will fail.
If either halts
the evaluation will halt too.
Gets a projection of this stream that allows converting it to a Pull
in a number of ways.
Gets a projection of this stream that allows converting it to a Pull
in a number of ways.