final class InvariantOps[F[_], O] extends AnyVal
- Alphabetic
- By Inheritance
- InvariantOps
- AnyVal
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from InvariantOps[F, O] to any2stringadd[InvariantOps[F, O]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (InvariantOps[F, O], B)
- Implicit
- This member is added by an implicit conversion from InvariantOps[F, O] to ArrowAssoc[InvariantOps[F, O]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
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
ensuring(cond: (InvariantOps[F, O]) ⇒ Boolean, msg: ⇒ Any): InvariantOps[F, O]
- Implicit
- This member is added by an implicit conversion from InvariantOps[F, O] to Ensuring[InvariantOps[F, O]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (InvariantOps[F, O]) ⇒ Boolean): InvariantOps[F, O]
- Implicit
- This member is added by an implicit conversion from InvariantOps[F, O] to Ensuring[InvariantOps[F, O]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): InvariantOps[F, O]
- Implicit
- This member is added by an implicit conversion from InvariantOps[F, O] to Ensuring[InvariantOps[F, O]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): InvariantOps[F, O]
- Implicit
- This member is added by an implicit conversion from InvariantOps[F, O] to Ensuring[InvariantOps[F, O]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from InvariantOps[F, O] to StringFormat[InvariantOps[F, O]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
observe(sink: Sink[F, O])(implicit F: Concurrent[F]): Stream[F, O]
Synchronously sends values through
sink
.Synchronously sends values through
sink
.If
sink
fails, then resulting stream will fail. If sinkhalts
the evaluation will halt too.Note that observe will only output full chunks of
O
that are known to be successfully processed bysink
. So if Sink terminates/fail in middle of chunk processing, the chunk will not be available in resulting stream.Note that if your sink can be represented by an
O => F[Unit]
,evalTap
will provide much greater performance.scala> import cats.effect.{ContextShift, IO}, cats.implicits._ scala> implicit val cs: ContextShift[IO] = IO.contextShift(scala.concurrent.ExecutionContext.Implicits.global) scala> Stream(1, 2, 3).covary[IO].observe(Sink.showLinesStdOut).map(_ + 1).compile.toVector.unsafeRunSync res0: Vector[Int] = Vector(2, 3, 4)
Example: -
def
observeAsync(maxQueued: Int)(sink: Sink[F, O])(implicit F: Concurrent[F]): Stream[F, O]
Send chunks through
sink
, allowing up tomaxQueued
pending _chunks_ before blockings
. -
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](using: (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
-
def
→[B](y: B): (InvariantOps[F, O], B)
- Implicit
- This member is added by an implicit conversion from InvariantOps[F, O] to ArrowAssoc[InvariantOps[F, O]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc