object ZSink extends ZSinkPlatformSpecificConstructors
- Alphabetic
- By Inheritance
- ZSink
- ZSinkPlatformSpecificConstructors
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def accessSink[R]: AccessSinkPartiallyApplied[R]
Accesses the environment of the sink in the context of a sink.
- def apply[R, E, I, L, Z](push: ZManaged[R, Nothing, Push[R, E, I, L, Z]]): ZSink[R, E, I, L, Z]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def collectAll[A](implicit trace: ZTraceElement): ZSink[Any, Nothing, A, Nothing, Chunk[A]]
A sink that collects all of its inputs into a chunk.
- def collectAllToMap[A, K](key: (A) => K)(f: (A, A) => A)(implicit trace: ZTraceElement): ZSink[Any, Nothing, A, Nothing, Map[K, A]]
A sink that collects all of its inputs into a map.
A sink that collects all of its inputs into a map. The keys are extracted from inputs using the keying function
key; if multiple inputs use the same key, they are merged using theffunction. - def collectAllToSet[A](implicit trace: ZTraceElement): ZSink[Any, Nothing, A, Nothing, Set[A]]
A sink that collects all of its inputs into a set.
- def count(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Long]
A sink that counts the number of elements fed to it.
- def die(e: => Throwable)(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Nothing]
Creates a sink halting with the specified
Throwable. - def dieMessage(m: => String)(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Nothing]
Creates a sink halting with the specified message, wrapped in a
RuntimeException. - def drain(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Unit]
A sink that ignores its inputs.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fail[E, I](e: => E)(implicit trace: ZTraceElement): ZSink[Any, E, I, I, Nothing]
A sink that always fails with the specified error.
- def failCause[E](e: => Cause[E])(implicit trace: ZTraceElement): ZSink[Any, E, Any, Nothing, Nothing]
Creates a sink halting with a specified cause.
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fold[I, S](z: S)(contFn: (S) => Boolean)(f: (S, I) => S)(implicit trace: ZTraceElement): ZSink[Any, Nothing, I, I, S]
A sink that folds its inputs with the provided function, termination predicate and initial state.
- def foldChunks[I, S](z: S)(contFn: (S) => Boolean)(f: (S, Chunk[I]) => S)(implicit trace: ZTraceElement): ZSink[Any, Nothing, I, I, S]
A sink that folds its input chunks with the provided function, termination predicate and initial state.
A sink that folds its input chunks with the provided function, termination predicate and initial state.
contFncondition is checked only for the initial value and at the end of processing of each chunk.fandcontFnmust preserve chunking-invariance. - def foldChunksZIO[R, E, I, S](z: S)(contFn: (S) => Boolean)(f: (S, Chunk[I]) => ZIO[R, E, S])(implicit trace: ZTraceElement): ZSink[R, E, I, I, S]
A sink that effectfully folds its input chunks with the provided function, termination predicate and initial state.
A sink that effectfully folds its input chunks with the provided function, termination predicate and initial state.
contFncondition is checked only for the initial value and at the end of processing of each chunk.fandcontFnmust preserve chunking-invariance. - def foldLeft[I, S](z: S)(f: (S, I) => S)(implicit trace: ZTraceElement): ZSink[Any, Nothing, I, Nothing, S]
A sink that folds its inputs with the provided function and initial state.
- def foldLeftChunks[I, S](z: S)(f: (S, Chunk[I]) => S)(implicit trace: ZTraceElement): ZSink[Any, Nothing, I, Nothing, S]
A sink that folds its input chunks with the provided function and initial state.
A sink that folds its input chunks with the provided function and initial state.
fmust preserve chunking-invariance. - def foldLeftChunksZIO[R, E, I, S](z: S)(f: (S, Chunk[I]) => ZIO[R, E, S])(implicit trace: ZTraceElement): ZSink[R, E, I, Nothing, S]
A sink that effectfully folds its input chunks with the provided function and initial state.
A sink that effectfully folds its input chunks with the provided function and initial state.
fmust preserve chunking-invariance. - def foldLeftZIO[R, E, I, S](z: S)(f: (S, I) => ZIO[R, E, S])(implicit trace: ZTraceElement): ZSink[R, E, I, I, S]
A sink that effectfully folds its inputs with the provided function and initial state.
- def foldZIO[R, E, I, S](z: S)(contFn: (S) => Boolean)(f: (S, I) => ZIO[R, E, S])(implicit trace: ZTraceElement): ZSink[R, E, I, I, S]
A sink that effectfully folds its inputs with the provided function, termination predicate and initial state.
A sink that effectfully folds its inputs with the provided function, termination predicate and initial state.
This sink may terminate in the middle of a chunk and discard the rest of it. See the discussion on the ZSink class scaladoc on sinks vs. transducers.
- def foreach[R, E, I](f: (I) => ZIO[R, E, Any])(implicit trace: ZTraceElement): ZSink[R, E, I, I, Unit]
A sink that executes the provided effectful function for every element fed to it.
- def foreachChunk[R, E, I](f: (Chunk[I]) => ZIO[R, E, Any])(implicit trace: ZTraceElement): ZSink[R, E, I, Nothing, Unit]
A sink that executes the provided effectful function for every chunk fed to it.
- final def foreachWhile[R, E, I](f: (I) => ZIO[R, E, Boolean])(implicit trace: ZTraceElement): ZSink[R, E, I, I, Unit]
A sink that executes the provided effectful function for every element fed to it until
fevaluates tofalse. - def fromHub[R, E, I](hub: ZHub[R, Nothing, E, Any, I, Any])(implicit trace: ZTraceElement): ZSink[R, E, I, Nothing, Unit]
Create a sink which publishes each element to the specified hub.
- def fromHubWithShutdown[R, E, I](hub: ZHub[R, Nothing, E, Any, I, Any])(implicit trace: ZTraceElement): ZSink[R, E, I, Nothing, Unit]
Create a sink which publishes each element to the specified hub.
Create a sink which publishes each element to the specified hub. The hub will be shutdown once the stream is closed.
- def fromPush[R, E, I, L, Z](sink: Push[R, E, I, L, Z])(implicit trace: ZTraceElement): ZSink[R, E, I, L, Z]
- def fromQueue[R, E, I](queue: ZQueue[R, Nothing, E, Any, I, Any])(implicit trace: ZTraceElement): ZSink[R, E, I, Nothing, Unit]
Create a sink which enqueues each element into the specified queue.
- def fromQueueWithShutdown[R, E, I](queue: ZQueue[R, Nothing, E, Any, I, Any])(implicit trace: ZTraceElement): ZSink[R, E, I, Nothing, Unit]
Create a sink which enqueues each element into the specified queue.
Create a sink which enqueues each element into the specified queue. The queue will be shutdown once the stream is closed.
- def fromZIO[R, E, I, Z](b: => ZIO[R, E, Z])(implicit trace: ZTraceElement): ZSink[R, E, I, I, Z]
Creates a single-value sink produced from an effect
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def head[I](implicit trace: ZTraceElement): ZSink[Any, Nothing, I, I, Option[I]]
Creates a sink containing the first value.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def last[I](implicit trace: ZTraceElement): ZSink[Any, Nothing, I, Nothing, Option[I]]
Creates a sink containing the last value.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def succeed[I, Z](z: => Z)(implicit trace: ZTraceElement): ZSink[Any, Nothing, I, I, Z]
A sink that immediately ends with the specified value.
- def sum[A](implicit A: Numeric[A], trace: ZTraceElement): ZSink[Any, Nothing, A, Nothing, A]
A sink that sums incoming numeric values.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def take[I](n: Int)(implicit trace: ZTraceElement): ZSink[Any, Nothing, I, I, Chunk[I]]
A sink that takes the specified number of values.
- def timed(implicit trace: ZTraceElement): ZSink[Has[Clock], Nothing, Any, Nothing, zio.Duration]
A sink with timed execution.
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unwrap[R, E, I, L <: I, Z](zio: ZIO[R, E, ZSink[R, E, I, L, Z]])(implicit trace: ZTraceElement): ZSink[R, E, I, I, Z]
Creates a sink produced from an effect.
- def unwrapManaged[R, E, I, L <: I, Z](managed: ZManaged[R, E, ZSink[R, E, I, L, Z]])(implicit trace: ZTraceElement): ZSink[R, E, I, I, Z]
Creates a sink produced from a managed effect.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object Push
Deprecated Value Members
- def foldChunksM[R, E, I, S](z: S)(contFn: (S) => Boolean)(f: (S, Chunk[I]) => ZIO[R, E, S])(implicit trace: ZTraceElement): ZSink[R, E, I, I, S]
A sink that effectfully folds its input chunks with the provided function, termination predicate and initial state.
A sink that effectfully folds its input chunks with the provided function, termination predicate and initial state.
contFncondition is checked only for the initial value and at the end of processing of each chunk.fandcontFnmust preserve chunking-invariance.- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use foldChunksZIO
- def foldLeftChunksM[R, E, I, S](z: S)(f: (S, Chunk[I]) => ZIO[R, E, S])(implicit trace: ZTraceElement): ZSink[R, E, I, Nothing, S]
A sink that effectfully folds its input chunks with the provided function and initial state.
A sink that effectfully folds its input chunks with the provided function and initial state.
fmust preserve chunking-invariance.- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use foldLeftChunksZIO
- def foldLeftM[R, E, I, S](z: S)(f: (S, I) => ZIO[R, E, S])(implicit trace: ZTraceElement): ZSink[R, E, I, I, S]
A sink that effectfully folds its inputs with the provided function and initial state.
A sink that effectfully folds its inputs with the provided function and initial state.
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use foldLeftZIO
- def foldM[R, E, I, S](z: S)(contFn: (S) => Boolean)(f: (S, I) => ZIO[R, E, S])(implicit trace: ZTraceElement): ZSink[R, E, I, I, S]
A sink that effectfully folds its inputs with the provided function, termination predicate and initial state.
A sink that effectfully folds its inputs with the provided function, termination predicate and initial state.
This sink may terminate in the middle of a chunk and discard the rest of it. See the discussion on the ZSink class scaladoc on sinks vs. transducers.
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use foldZIO
- def fromEffect[R, E, I, Z](b: => ZIO[R, E, Z])(implicit trace: ZTraceElement): ZSink[R, E, I, I, Z]
Creates a single-value sink produced from an effect
Creates a single-value sink produced from an effect
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use fromZIO
- def halt[E](e: => Cause[E])(implicit trace: ZTraceElement): ZSink[Any, E, Any, Nothing, Nothing]
Creates a sink halting with a specified cause.
Creates a sink halting with a specified cause.
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use failCause
- def managed[R, E, I, A, L <: I, Z](resource: ZManaged[R, E, A])(fn: (A) => ZSink[R, E, I, L, Z])(implicit trace: ZTraceElement): ZSink[R, E, I, I, Z]
Creates a single valued sink from a managed resource.
Creates a single valued sink from a managed resource.
- Annotations
- @deprecated
- Deprecated
(Since version 2.0.0) use unwrapManaged