implicit final class InvariantOps[F[_], O] extends AnyVal
- Alphabetic
- By Inheritance
- InvariantOps
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
covary[F2[x] >: F[x]]: Stream[F2, O]
Lifts this stream to the specified effect type.
Lifts this stream to the specified effect type.
scala> import cats.effect.IO scala> Stream(1, 2, 3).covary[IO] res0: Stream[IO,Int] = Stream(..)
Example: -
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
observe(p: Pipe[F, O, INothing])(implicit F: Concurrent[F]): Stream[F, O]
Synchronously sends values through
p
.Synchronously sends values through
p
.If
p
fails, then resulting stream will fail. Ifp
halts the evaluation will halt too.Note that observe will only output full chunks of
O
that are known to be successfully processed byp
. So ifp
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.scala> import cats.effect.IO, cats.effect.unsafe.implicits.global scala> Stream(1, 2, 3).covary[IO].observe(_.showLinesStdOut).map(_ + 1).compile.toVector.unsafeRunSync() res0: Vector[Int] = Vector(2, 3, 4)
Example: -
def
observeAsync(maxQueued: Int)(p: Pipe[F, O, INothing])(implicit F: Concurrent[F]): Stream[F, O]
Send chunks through
p
, allowing up tomaxQueued
pending _chunks_ before blockings
. -
def
observeEither[L, R](left: Pipe[F, L, INothing], right: Pipe[F, R, INothing])(implicit F: Concurrent[F], ev: <:<[O, Either[L, R]]): Stream[F, Either[L, R]]
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
orright
fails, then resulting stream will fail. If eitherhalts
the evaluation will halt too. -
def
pull: ToPull[F, O]
Gets a projection of this stream that allows converting it to a
Pull
in a number of ways. -
def
repeatPull[O2](f: (ToPull[F, O]) ⇒ Pull[F, O2, Option[Stream[F, O]]]): Stream[F, O2]
Repeatedly invokes
using
, running the resultantPull
each time, halting when a pull returnsNone
instead ofSome(nextStream)
. -
def
toString(): String
- Definition Classes
- Any