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 EnvironmentWithSinkPartiallyApplied[R] extends AnyVal

    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. final def asInstanceOf[T0]: T0

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

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

    Permalink
  7. def collectAllN[In](n: ⇒ Int)(implicit trace: ZTraceElement): ZSink[Any, Nothing, In, In, Chunk[In]]

    Permalink

    A sink that collects first n elements into a chunk.

    A sink that collects first n elements into a chunk. Note that the chunk is preallocated and must fit in memory.

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

    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.

  9. def collectAllToMapN[Err, In, K](n: ⇒ Long)(key: (In) ⇒ K)(f: (In, In) ⇒ In)(implicit trace: ZTraceElement): ZSink[Any, Err, In, In, Map[K, In]]

    Permalink

    A sink that collects first n keys into a map.

    A sink that collects first n keys into a map. The keys are calculated from inputs using the keying function key; if multiple inputs use the the same key, they are merged using the f function.

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

    Permalink

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

  11. def collectAllToSetN[In](n: ⇒ Long)(implicit trace: ZTraceElement): ZSink[Any, Nothing, In, In, Set[In]]

    Permalink

    A sink that collects first n distinct inputs into a set.

  12. def collectAllWhile[In](p: (In) ⇒ Boolean)(implicit trace: ZTraceElement): ZSink[Any, Nothing, In, In, Chunk[In]]

    Permalink

    Accumulates incoming elements into a chunk as long as they verify predicate p.

  13. def collectAllWhileZIO[Env, Err, In](p: (In) ⇒ ZIO[Env, Err, Boolean])(implicit trace: ZTraceElement): ZSink[Env, Err, In, In, Chunk[In]]

    Permalink

    Accumulates incoming elements into a chunk as long as they verify effectful predicate p.

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

    Permalink

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

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

    Permalink

    Creates a sink halting with the specified Throwable.

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

  17. def digest(digest: ⇒ MessageDigest): ZSink[Any, Nothing, Byte, Nothing, Chunk[Byte]]

    Permalink

    Creates a sink which digests incoming bytes using Java's MessageDigest class, returning the digest value.

    Creates a sink which digests incoming bytes using Java's MessageDigest class, returning the digest value.

    Definition Classes
    ZSinkPlatformSpecificConstructors
  18. def drain(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Unit]

    Permalink

    A sink that ignores its inputs.

  19. def dropWhile[In](p: (In) ⇒ Boolean)(implicit trace: ZTraceElement): ZSink[Any, Nothing, In, In, Any]

    Permalink
  20. def dropWhileZIO[R, InErr, In](p: (In) ⇒ ZIO[R, InErr, Boolean])(implicit trace: ZTraceElement): ZSink[R, InErr, In, In, Any]

    Permalink
  21. def environmentWithSink[R]: EnvironmentWithSinkPartiallyApplied[R]

    Permalink

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

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

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

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

    Permalink

    A sink that always fails with the specified error.

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

    Permalink

    Creates a sink halting with a specified cause.

  26. def finalize(): Unit

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

    Permalink

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

  28. def foldChunks[In, S](z: ⇒ S)(contFn: (S) ⇒ Boolean)(f: (S, Chunk[In]) ⇒ S)(implicit trace: ZTraceElement): ZSink[Any, Nothing, In, Nothing, 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.

  29. def foldChunksZIO[Env, Err, In, S](z: ⇒ S)(contFn: (S) ⇒ Boolean)(f: (S, Chunk[In]) ⇒ ZIO[Env, Err, S])(implicit trace: ZTraceElement): ZSink[Env, Err, In, In, 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.

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

    Permalink

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

  31. def foldLeftChunks[In, S](z: ⇒ S)(f: (S, Chunk[In]) ⇒ S)(implicit trace: ZTraceElement): ZSink[Any, Nothing, In, 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.

  32. def foldLeftChunksZIO[R, Err, In, S](z: ⇒ S)(f: (S, Chunk[In]) ⇒ ZIO[R, Err, S])(implicit trace: ZTraceElement): ZSink[R, Err, In, 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.

  33. def foldLeftZIO[R, Err, In, S](z: ⇒ S)(f: (S, In) ⇒ ZIO[R, Err, S])(implicit trace: ZTraceElement): ZSink[R, Err, In, In, S]

    Permalink

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

  34. def foldUntil[In, S](z: ⇒ S, max: ⇒ Long)(f: (S, In) ⇒ S)(implicit trace: ZTraceElement): ZSink[Any, Nothing, In, In, S]

    Permalink

    Creates a sink that folds elements of type In into a structure of type S until max elements have been folded.

    Creates a sink that folds elements of type In into a structure of type S until max elements have been folded.

    Like foldWeighted, but with a constant cost function of 1.

  35. def foldUntilZIO[Env, Err, In, S](z: ⇒ S, max: ⇒ Long)(f: (S, In) ⇒ ZIO[Env, Err, S])(implicit trace: ZTraceElement): ZSink[Env, Err, In, In, S]

    Permalink

    Creates a sink that effectfully folds elements of type In into a structure of type S until max elements have been folded.

    Creates a sink that effectfully folds elements of type In into a structure of type S until max elements have been folded.

    Like foldWeightedM, but with a constant cost function of 1.

  36. def foldWeighted[In, S](z: ⇒ S)(costFn: (S, In) ⇒ Long, max: ⇒ Long)(f: (S, In) ⇒ S)(implicit trace: ZTraceElement): ZSink[Any, Nothing, In, In, S]

    Permalink

    Creates a sink that folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    Creates a sink that folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    Note

    Elements that have an individual cost larger than max will force the sink to cross the max cost. See foldWeightedDecompose for a variant that can handle these cases.

  37. def foldWeightedDecompose[In, S](z: ⇒ S)(costFn: (S, In) ⇒ Long, max: ⇒ Long, decompose: (In) ⇒ Chunk[In])(f: (S, In) ⇒ S)(implicit trace: ZTraceElement): ZSink[Any, Nothing, In, In, S]

    Permalink

    Creates a sink that folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    Creates a sink that folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    The decompose function will be used for decomposing elements that cause an S aggregate to cross max into smaller elements. For example:

    Stream(1, 5, 1)
      .transduce(
        ZSink
          .foldWeightedDecompose(List[Int]())((i: Int) => i.toLong, 4,
            (i: Int) => Chunk(i - 1, 1)) { (acc, el) =>
            el :: acc
          }
          .map(_.reverse)
      )
      .runCollect

    The stream would emit the elements List(1), List(4), List(1, 1).

    Be vigilant with this function, it has to generate "simpler" values or the fold may never end. A value is considered indivisible if decompose yields the empty chunk or a single-valued chunk. In these cases, there is no other choice than to yield a value that will cross the threshold.

    The foldWeightedDecomposeM allows the decompose function to return a ZIO value, and consequently it allows the sink to fail.

  38. def foldWeightedDecomposeZIO[Env, Err, In, S](z: ⇒ S)(costFn: (S, In) ⇒ ZIO[Env, Err, Long], max: ⇒ Long, decompose: (In) ⇒ ZIO[Env, Err, Chunk[In]])(f: (S, In) ⇒ ZIO[Env, Err, S])(implicit trace: ZTraceElement): ZSink[Env, Err, In, In, S]

    Permalink

    Creates a sink that effectfully folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    Creates a sink that effectfully folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    The decompose function will be used for decomposing elements that cause an S aggregate to cross max into smaller elements. Be vigilant with this function, it has to generate "simpler" values or the fold may never end. A value is considered indivisible if decompose yields the empty chunk or a single-valued chunk. In these cases, there is no other choice than to yield a value that will cross the threshold.

    See foldWeightedDecompose for an example.

  39. def foldWeightedZIO[Env, Err, In, S](z: ⇒ S)(costFn: (S, In) ⇒ ZIO[Env, Err, Long], max: Long)(f: (S, In) ⇒ ZIO[Env, Err, S])(implicit trace: ZTraceElement): ZSink[Env, Err, In, In, S]

    Permalink

    Creates a sink that effectfully folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    Creates a sink that effectfully folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    Note

    Elements that have an individual cost larger than max will force the sink to cross the max cost. See foldWeightedDecomposeM for a variant that can handle these cases.

  40. def foldZIO[Env, Err, In, S](z: ⇒ S)(contFn: (S) ⇒ Boolean)(f: (S, In) ⇒ ZIO[Env, Err, S])(implicit trace: ZTraceElement): ZSink[Env, Err, In, In, S]

    Permalink

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

  41. def foreach[R, Err, In](f: (In) ⇒ ZIO[R, Err, Any])(implicit trace: ZTraceElement): ZSink[R, Err, In, Nothing, Unit]

    Permalink

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

  42. def foreachChunk[R, Err, In](f: (Chunk[In]) ⇒ ZIO[R, Err, Any])(implicit trace: ZTraceElement): ZSink[R, Err, In, Nothing, Unit]

    Permalink

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

  43. def foreachChunkWhile[R, Err, In](f: (Chunk[In]) ⇒ ZIO[R, Err, Boolean])(implicit trace: ZTraceElement): ZSink[R, Err, In, In, Unit]

    Permalink

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

  44. final def foreachWhile[R, Err, In](f: (In) ⇒ ZIO[R, Err, Boolean])(implicit trace: ZTraceElement): ZSink[R, Err, In, In, Unit]

    Permalink

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

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

    Permalink

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

    Uses the provided File 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
  46. final def fromFileString(name: ⇒ String, position: Long = 0L, options: Set[OpenOption] = ...)(implicit trace: ZTraceElement): ZSink[Any, Throwable, Byte, Byte, Long]

    Permalink

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

    Uses the provided Path represented as a string 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
  47. final def fromFileURI(uri: ⇒ URI, position: Long = 0L, options: Set[OpenOption] = ...)(implicit trace: ZTraceElement): ZSink[Any, Throwable, Byte, Byte, Long]

    Permalink

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

    Uses the provided URI 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
  48. 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.

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

  50. 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
  51. 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
  52. final def fromPath(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
  53. def fromPush[R, E, I, L, Z](push: ZManaged[R, Nothing, (Option[Chunk[I]]) ⇒ ZIO[R, (Either[E, Z], Chunk[L]), Unit]])(implicit trace: ZTraceElement): ZSink[R, E, I, L, Z]

    Permalink

    Creates a sink from a chunk processing function.

  54. def fromQueue[R, E, I](queue: ⇒ ZEnqueue[R, E, I])(implicit trace: ZTraceElement): ZSink[R, E, I, Nothing, Unit]

    Permalink

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

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

  56. def fromZIO[R, E, Z](b: ⇒ ZIO[R, E, Z])(implicit trace: ZTraceElement): ZSink[R, E, Any, Nothing, Z]

    Permalink

    Creates a single-value sink produced from an effect

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

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

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

    Permalink

    Creates a sink containing the first value.

  60. final def isInstanceOf[T0]: Boolean

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

    Permalink

    Creates a sink containing the last value.

  62. def leftover[L](c: ⇒ Chunk[L])(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, L, Unit]

    Permalink
  63. def log(message: ⇒ String)(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Unit]

    Permalink

    Logs the specified message at the current log level.

  64. def logAnnotate[R, E, In, L, Z](key: ⇒ String, value: ⇒ String)(sink: ZSink[R, E, In, L, Z])(implicit trace: ZTraceElement): ZSink[R, E, In, L, Z]

    Permalink

    Annotates each log in streams composed after this with the specified log annotation.

  65. def logAnnotations(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Map[String, String]]

    Permalink

    Retrieves the log annotations associated with the current scope.

  66. def logDebug(message: ⇒ String)(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Unit]

    Permalink

    Logs the specified message at the debug log level.

  67. def logError(message: ⇒ String)(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Unit]

    Permalink

    Logs the specified message at the error log level.

  68. def logErrorCause(cause: ⇒ Cause[Any])(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Unit]

    Permalink

    Logs the specified cause as an error.

  69. def logFatal(message: ⇒ String)(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Unit]

    Permalink

    Logs the specified message at the fatal log level.

  70. def logInfo(message: ⇒ String)(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Unit]

    Permalink

    Logs the specified message at the informational log level.

  71. def logLevel[R, E, In, L, Z](level: LogLevel)(sink: ZSink[R, E, In, L, Z])(implicit trace: ZTraceElement): ZSink[R, E, In, L, Z]

    Permalink

    Sets the log level for streams composed after this.

  72. def logSpan[R, E, In, L, Z](label: ⇒ String)(sink: ZSink[R, E, In, L, Z])(implicit trace: ZTraceElement): ZSink[R, E, In, L, Z]

    Permalink

    Adjusts the label for the logging span for streams composed after this.

  73. def logTrace(message: ⇒ String)(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Unit]

    Permalink

    Logs the specified message at the trace log level.

  74. def logWarning(message: ⇒ String)(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Unit]

    Permalink

    Logs the specified message at the warning log level.

  75. def mkString(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, String]

    Permalink
  76. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  77. def never(implicit trace: ZTraceElement): ZSink[Any, Nothing, Any, Nothing, Nothing]

    Permalink
  78. final def notify(): Unit

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

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

    Permalink

    A sink that immediately ends with the specified value.

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

    Permalink

    A sink that sums incoming numeric values.

  82. def suspend[Env, E, In, Leftover, Done](sink: ⇒ ZSink[Env, E, In, Leftover, Done])(implicit trace: ZTraceElement): ZSink[Env, E, In, Leftover, Done]

    Permalink

    Returns a lazily constructed sink that may require effects for its creation.

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

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

    Permalink

    A sink that takes the specified number of values.

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

    Permalink
  86. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  87. def unwrap[R, E, In, L, Z](zio: ⇒ ZIO[R, E, ZSink[R, E, In, L, Z]])(implicit trace: ZTraceElement): ZSink[R, E, In, L, Z]

    Permalink

    Creates a sink produced from an effect.

  88. def unwrapManaged[R, E, In, L, Z](managed: ⇒ ZManaged[R, E, ZSink[R, E, In, L, Z]])(implicit trace: ZTraceElement): ZSink[R, E, In, L, Z]

    Permalink

    Creates a sink produced from a managed effect.

  89. final def wait(): Unit

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

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

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

Deprecated Value Members

  1. def collectAllWhileM[Env, Err, In](p: (In) ⇒ ZIO[Env, Err, Boolean])(implicit trace: ZTraceElement): ZSink[Env, Err, In, In, Chunk[In]]

    Permalink

    Accumulates incoming elements into a chunk as long as they verify effectful predicate p.

    Accumulates incoming elements into a chunk as long as they verify effectful predicate p.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use collectAllWhileZIO

  2. def dropWhileM[R, InErr, In](p: (In) ⇒ ZIO[R, InErr, Boolean])(implicit trace: ZTraceElement): ZSink[R, InErr, In, In, Any]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use dropWhileZIO

  3. def effectSuspendTotal[Env, E, In, Leftover, Done](sink: ⇒ ZSink[Env, E, In, Leftover, Done])(implicit trace: ZTraceElement): ZSink[Env, E, In, Leftover, Done]

    Permalink

    Returns a lazily constructed sink that may require effects for its creation.

    Returns a lazily constructed sink that may require effects for its creation.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use suspend

  4. def effectTotal[A](a: ⇒ A)(implicit trace: ZTraceElement): ZSink[Any, Any, Nothing, Nothing, A]

    Permalink

    Returns a sink that executes a total effect and ends with its result.

    Returns a sink that executes a total effect and ends with its result.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use succeed

  5. def foldChunksM[Env, Err, In, S](z: ⇒ S)(contFn: (S) ⇒ Boolean)(f: (S, Chunk[In]) ⇒ ZIO[Env, Err, S])(implicit trace: ZTraceElement): ZSink[Env, Err, In, In, 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

  6. def foldLeftChunksM[R, Err, In, S](z: ⇒ S)(f: (S, Chunk[In]) ⇒ ZIO[R, Err, S])(implicit trace: ZTraceElement): ZSink[R, Err, In, 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

  7. def foldLeftM[R, Err, In, S](z: ⇒ S)(f: (S, In) ⇒ ZIO[R, Err, S])(implicit trace: ZTraceElement): ZSink[R, Err, In, In, 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

  8. def foldM[Env, Err, In, S](z: ⇒ S)(contFn: (S) ⇒ Boolean)(f: (S, In) ⇒ ZIO[Env, Err, S])(implicit trace: ZTraceElement): ZSink[Env, Err, In, In, 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.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use foldZIO

  9. def foldUntilM[Env, Err, In, S](z: ⇒ S, max: ⇒ Long)(f: (S, In) ⇒ ZIO[Env, Err, S])(implicit trace: ZTraceElement): ZSink[Env, Err, In, In, S]

    Permalink

    Creates a sink that effectfully folds elements of type In into a structure of type S until max elements have been folded.

    Creates a sink that effectfully folds elements of type In into a structure of type S until max elements have been folded.

    Like foldWeightedM, but with a constant cost function of 1.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use foldUntilZIO

  10. def foldWeightedDecomposeM[Env, Err, In, S](z: ⇒ S)(costFn: (S, In) ⇒ ZIO[Env, Err, Long], max: ⇒ Long, decompose: (In) ⇒ ZIO[Env, Err, Chunk[In]])(f: (S, In) ⇒ ZIO[Env, Err, S])(implicit trace: ZTraceElement): ZSink[Env, Err, In, In, S]

    Permalink

    Creates a sink that effectfully folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    Creates a sink that effectfully folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    The decompose function will be used for decomposing elements that cause an S aggregate to cross max into smaller elements. Be vigilant with this function, it has to generate "simpler" values or the fold may never end. A value is considered indivisible if decompose yields the empty chunk or a single-valued chunk. In these cases, there is no other choice than to yield a value that will cross the threshold.

    See foldWeightedDecompose for an example.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use foldWeightedDecomposeZIO

  11. def foldWeightedM[Env, Err, In, S](z: ⇒ S)(costFn: (S, In) ⇒ ZIO[Env, Err, Long], max: Long)(f: (S, In) ⇒ ZIO[Env, Err, S])(implicit trace: ZTraceElement): ZSink[Env, Err, In, In, S]

    Permalink

    Creates a sink that effectfully folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    Creates a sink that effectfully folds elements of type In into a structure of type S, until max worth of elements (determined by the costFn) have been folded.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0-) use foldWeightedZIO

    Note

    Elements that have an individual cost larger than max will force the sink to cross the max cost. See foldWeightedDecomposeM for a variant that can handle these cases.

  12. def fromEffect[R, E, Z](b: ⇒ ZIO[R, E, Z])(implicit trace: ZTraceElement): ZSink[R, E, Any, Nothing, 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

  13. def halt[E](e: ⇒ Cause[E])(implicit trace: ZTraceElement): ZSink[Any, Any, E, 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

  14. def managed[R, E, In, A, L <: In, Z](resource: ⇒ ZManaged[R, E, A])(fn: (A) ⇒ ZSink[R, E, In, L, Z])(implicit trace: ZTraceElement): ZSink[R, E, In, In, Z]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use unwrapManaged

Inherited from AnyRef

Inherited from Any

Ungrouped