Object/Class

zio.stream

ZSink

Related Docs: class ZSink | package stream

Permalink

object ZSink extends ZSinkPlatformSpecificConstructors

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZSink
  2. ZSinkPlatformSpecificConstructors
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final class AccessSinkPartiallyApplied[R] extends AnyVal

    Permalink
  2. type Push[-R, +E, -I, +L, +Z] = (Option[Chunk[I]]) ⇒ ZIO[R, (Either[E, Z], Chunk[L]), Unit]

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object Push

    Permalink
  5. def accessSink[R]: AccessSinkPartiallyApplied[R]

    Permalink

    Accesses the environment of the sink in the context of a sink.

  6. def apply[R, E, I, L, Z](push: ZManaged[R, Nothing, Push[R, E, I, L, Z]]): ZSink[R, E, I, L, Z]

    Permalink
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def collectAll[A](implicit trace: ZTraceElement): ZSink[Any, Nothing, A, Nothing, Chunk[A]]

    Permalink

    A sink that collects all of its inputs into a chunk.

  10. def collectAllToMap[A, K](key: (A) ⇒ K)(f: (A, A) ⇒ A)(implicit trace: ZTraceElement): ZSink[Any, Nothing, A, Nothing, Map[K, A]]

    Permalink

    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 the f function.

  11. def collectAllToSet[A](implicit trace: ZTraceElement): ZSink[Any, Nothing, A, Nothing, Set[A]]

    Permalink

    A sink that collects all of its inputs into a set.

  12. def count(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Long]

    Permalink

    A sink that counts the number of elements fed to it.

  13. def die(e: ⇒ Throwable)(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Nothing]

    Permalink

    Creates a sink halting with the specified Throwable.

  14. def dieMessage(m: ⇒ String)(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Nothing]

    Permalink

    Creates a sink halting with the specified message, wrapped in a RuntimeException.

  15. def drain(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Unit]

    Permalink

    A sink that ignores its inputs.

  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  18. def fail[E, I](e: ⇒ E)(implicit trace: ZTraceElement): ZSink[Any, E, I, I, Nothing]

    Permalink

    A sink that always fails with the specified error.

  19. def failCause[E](e: ⇒ Cause[E])(implicit trace: ZTraceElement): ZSink[Any, E, Any, Nothing, Nothing]

    Permalink

    Creates a sink halting with a specified cause.

  20. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def fold[I, S](z: S)(contFn: (S) ⇒ Boolean)(f: (S, I) ⇒ S)(implicit trace: ZTraceElement): ZSink[Any, Nothing, I, I, S]

    Permalink

    A sink that folds its inputs with the provided function, termination predicate and initial state.

  22. def foldChunks[I, S](z: S)(contFn: (S) ⇒ Boolean)(f: (S, Chunk[I]) ⇒ S)(implicit trace: ZTraceElement): ZSink[Any, Nothing, I, I, S]

    Permalink

    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. contFn condition is checked only for the initial value and at the end of processing of each chunk. f and contFn must preserve chunking-invariance.

  23. 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]

    Permalink

    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. contFn condition is checked only for the initial value and at the end of processing of each chunk. f and contFn must preserve chunking-invariance.

  24. def foldLeft[I, S](z: S)(f: (S, I) ⇒ S)(implicit trace: ZTraceElement): ZSink[Any, Nothing, I, Nothing, S]

    Permalink

    A sink that folds its inputs with the provided function and initial state.

  25. def foldLeftChunks[I, S](z: S)(f: (S, Chunk[I]) ⇒ S)(implicit trace: ZTraceElement): ZSink[Any, Nothing, I, Nothing, S]

    Permalink

    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. f must preserve chunking-invariance.

  26. 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]

    Permalink

    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. f must preserve chunking-invariance.

  27. def foldLeftZIO[R, E, I, S](z: S)(f: (S, I) ⇒ ZIO[R, E, S])(implicit trace: ZTraceElement): ZSink[R, E, I, I, S]

    Permalink

    A sink that effectfully folds its inputs with the provided function and initial state.

  28. 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]

    Permalink

    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.

  29. def foreach[R, E, I](f: (I) ⇒ ZIO[R, E, Any])(implicit trace: ZTraceElement): ZSink[R, E, I, I, Unit]

    Permalink

    A sink that executes the provided effectful function for every element fed to it.

  30. def foreachChunk[R, E, I](f: (Chunk[I]) ⇒ ZIO[R, E, Any])(implicit trace: ZTraceElement): ZSink[R, E, I, Nothing, Unit]

    Permalink

    A sink that executes the provided effectful function for every chunk fed to it.

  31. final def foreachWhile[R, E, I](f: (I) ⇒ ZIO[R, E, Boolean])(implicit trace: ZTraceElement): ZSink[R, E, I, I, Unit]

    Permalink

    A sink that executes the provided effectful function for every element fed to it until f evaluates to false.

  32. final def fromFile(path: ⇒ Path, position: Long = 0L, options: Set[OpenOption] = ...)(implicit trace: ZTraceElement): ZSink[Any, Throwable, Byte, Byte, Long]

    Permalink

    Uses the provided Path to create a ZSink that consumes byte chunks and writes them to the File.

    Uses the provided Path to create a ZSink that consumes byte chunks and writes them to the File. The sink will yield count of bytes written.

    Definition Classes
    ZSinkPlatformSpecificConstructors
  33. def fromHub[R, E, I](hub: ZHub[R, Nothing, E, Any, I, Any])(implicit trace: ZTraceElement): ZSink[R, E, I, Nothing, Unit]

    Permalink

    Create a sink which publishes each element to the specified hub.

  34. def fromHubWithShutdown[R, E, I](hub: ZHub[R, Nothing, E, Any, I, Any])(implicit trace: ZTraceElement): ZSink[R, E, I, Nothing, Unit]

    Permalink

    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.

  35. final def fromOutputStream(os: OutputStream)(implicit trace: ZTraceElement): ZSink[Any, IOException, Byte, Byte, Long]

    Permalink

    Uses the provided OutputStream to create a ZSink that consumes byte chunks and writes them to the OutputStream.

    Uses the provided OutputStream to create a ZSink that consumes byte chunks and writes them to the OutputStream. The sink will yield the count of bytes written.

    The caller of this function is responsible for closing the OutputStream.

    Definition Classes
    ZSinkPlatformSpecificConstructors
  36. final def fromOutputStreamManaged(os: ZManaged[Any, IOException, OutputStream])(implicit trace: ZTraceElement): ZSink[Any, IOException, Byte, Byte, Long]

    Permalink

    Uses the provided OutputStream resource to create a ZSink that consumes byte chunks and writes them to the OutputStream.

    Uses the provided OutputStream resource to create a ZSink that consumes byte chunks and writes them to the OutputStream. The sink will yield the count of bytes written.

    The OutputStream will be automatically closed after the stream is finished or an error occurred.

    Definition Classes
    ZSinkPlatformSpecificConstructors
  37. def fromPush[R, E, I, L, Z](sink: Push[R, E, I, L, Z])(implicit trace: ZTraceElement): ZSink[R, E, I, L, Z]

    Permalink
  38. def fromQueue[R, E, I](queue: ZQueue[R, Nothing, E, Any, I, Any])(implicit trace: ZTraceElement): ZSink[R, E, I, Nothing, Unit]

    Permalink

    Create a sink which enqueues each element into the specified queue.

  39. def fromQueueWithShutdown[R, E, I](queue: ZQueue[R, Nothing, E, Any, I, Any])(implicit trace: ZTraceElement): ZSink[R, E, I, Nothing, Unit]

    Permalink

    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.

  40. def fromZIO[R, E, I, Z](b: ⇒ ZIO[R, E, Z])(implicit trace: ZTraceElement): ZSink[R, E, I, I, Z]

    Permalink

    Creates a single-value sink produced from an effect

  41. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  42. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  43. def head[I](implicit trace: ZTraceElement): ZSink[Any, Nothing, I, I, Option[I]]

    Permalink

    Creates a sink containing the first value.

  44. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  45. def last[I](implicit trace: ZTraceElement): ZSink[Any, Nothing, I, Nothing, Option[I]]

    Permalink

    Creates a sink containing the last value.

  46. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  47. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  48. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  49. def succeed[I, Z](z: ⇒ Z)(implicit trace: ZTraceElement): ZSink[Any, Nothing, I, I, Z]

    Permalink

    A sink that immediately ends with the specified value.

  50. def sum[A](implicit A: Numeric[A], trace: ZTraceElement): ZSink[Any, Nothing, A, Nothing, A]

    Permalink

    A sink that sums incoming numeric values.

  51. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  52. def take[I](n: Int)(implicit trace: ZTraceElement): ZSink[Any, Nothing, I, I, Chunk[I]]

    Permalink

    A sink that takes the specified number of values.

  53. def timed(implicit trace: ZTraceElement): ZSink[Has[Clock], Nothing, Any, Nothing, zio.Duration]

    Permalink

    A sink with timed execution.

  54. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  55. 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]

    Permalink

    Creates a sink produced from an effect.

  56. 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]

    Permalink

    Creates a sink produced from a managed effect.

  57. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  58. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. 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]

    Permalink

    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. contFn condition is checked only for the initial value and at the end of processing of each chunk. f and contFn must preserve chunking-invariance.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use foldChunksZIO

  2. 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]

    Permalink

    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. f must preserve chunking-invariance.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use foldLeftChunksZIO

  3. def foldLeftM[R, E, I, S](z: S)(f: (S, I) ⇒ ZIO[R, E, S])(implicit trace: ZTraceElement): ZSink[R, E, I, I, S]

    Permalink

    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

  4. 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]

    Permalink

    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

  5. def fromEffect[R, E, I, Z](b: ⇒ ZIO[R, E, Z])(implicit trace: ZTraceElement): ZSink[R, E, I, I, Z]

    Permalink

    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

  6. def halt[E](e: ⇒ Cause[E])(implicit trace: ZTraceElement): ZSink[Any, E, Any, Nothing, Nothing]

    Permalink

    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

  7. 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]

    Permalink

    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

Inherited from AnyRef

Inherited from Any

Ungrouped