Object/Trait

zio.stream

ZSink

Related Docs: trait ZSink | package stream

Permalink

object ZSink extends ZSinkPlatformSpecificConstructors with Serializable

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

Type Members

  1. implicit final class InputRemainderOps[R, E, A, B] extends AnyRef

    Permalink
  2. implicit final class InvariantOps[R, E, A0, A, B] extends AnyVal

    Permalink
  3. implicit final class NoRemainderOps[R, E, A, B] 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 await[A]: ZSink[Any, Unit, Nothing, A, A]

    Permalink

    Creates a sink that waits for a single value to be produced.

  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def collectAll[A]: ZSink[Any, Nothing, Nothing, A, List[A]]

    Permalink

    Creates a sink accumulating incoming values into a list.

  8. def collectAllN[A](n: Long): ZSink[Any, Nothing, A, A, List[A]]

    Permalink

    Creates a sink accumulating incoming values into a list of maximum size n.

  9. def collectAllToMap[K, A](key: (A) ⇒ K)(f: (A, A) ⇒ A): Sink[Nothing, Nothing, A, Map[K, A]]

    Permalink

    Creates a sink accumulating incoming values into a map.

    Creates a sink accumulating incoming values into a map. Key of each element is determined by supplied function. Combines elements with same key with supplied function f.

  10. def collectAllToMapN[K, A](n: Long)(key: (A) ⇒ K)(f: (A, A) ⇒ A): Sink[Nothing, A, A, Map[K, A]]

    Permalink

    Creates a sink accumulating incoming values into a map of maximum size n.

    Creates a sink accumulating incoming values into a map of maximum size n. Key of each element is determined by supplied function.

    Combines elements with same key with supplied function f.

  11. def collectAllToSet[A]: ZSink[Any, Nothing, Nothing, A, Set[A]]

    Permalink

    Creates a sink accumulating incoming values into a set.

  12. def collectAllToSetN[A](n: Long): ZSink[Any, Nothing, A, A, Set[A]]

    Permalink

    Creates a sink accumulating incoming values into a set of maximum size n.

  13. def collectAllWhile[A](p: (A) ⇒ Boolean): ZSink[Any, Nothing, A, A, List[A]]

    Permalink

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

  14. def collectAllWhileM[R, E, A](p: (A) ⇒ ZIO[R, E, Boolean]): ZSink[R, E, A, A, List[A]]

    Permalink

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

  15. def count[A]: ZSink[Any, Nothing, Nothing, A, Long]

    Permalink

    Creates a sink which emits the number of elements processed

  16. def die(e: ⇒ Throwable): ZSink[Any, Nothing, Nothing, Any, Nothing]

    Permalink

    Creates a sink halting with the specified Throwable.

  17. def dieMessage(m: ⇒ String): ZSink[Any, Nothing, Nothing, Any, Nothing]

    Permalink

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

  18. def drain: ZSink[Any, Nothing, Nothing, Any, Unit]

    Permalink

    Creates a sink consuming all incoming values until completion.

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

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

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

    Permalink

    Creates a sink failing with a value of type E.

  22. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  23. def fold[A0, A, S](z: S)(contFn: (S) ⇒ Boolean)(f: (S, A) ⇒ (S, Chunk[A0])): ZSink[Any, Nothing, A0, A, S]

    Permalink

    Creates a sink by folding over a structure of type S.

  24. def foldLeft[A, S](z: S)(f: (S, A) ⇒ S): ZSink[Any, Nothing, Nothing, A, S]

    Permalink

    Creates a sink by folding over a structure of type S.

  25. def foldLeftM[R, E, A, S](z: S)(f: (S, A) ⇒ ZIO[R, E, S]): ZSink[R, E, Nothing, A, S]

    Permalink

    Creates a sink by effectfully folding over a structure of type S.

  26. def foldM[R, E, A0, A, S](z: S)(contFn: (S) ⇒ Boolean)(f: (S, A) ⇒ ZIO[R, E, (S, Chunk[A0])]): ZSink[R, E, A0, A, S]

    Permalink

    Creates a sink by effectfully folding over a structure of type S.

  27. def foldUntil[S, A](z: S, max: Long)(f: (S, A) ⇒ S): ZSink[Any, Nothing, A, A, S]

    Permalink

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

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

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

  28. def foldUntilM[R, E, S, A](z: S, max: Long)(f: (S, A) ⇒ ZIO[R, E, S]): ZSink[R, E, A, A, S]

    Permalink

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

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

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

  29. def foldWeighted[A, S](z: S)(costFn: (A) ⇒ Long, max: Long)(f: (S, A) ⇒ S): ZSink[Any, Nothing, A, A, S]

    Permalink

    Creates a sink that folds elements of type A 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 A 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 cause the stream to hang. See ZSink.foldWeightedDecompose for a variant that can handle these.

  30. def foldWeightedDecompose[A, S](z: S)(costFn: (A) ⇒ Long, max: Long, decompose: (A) ⇒ Chunk[A])(f: (S, A) ⇒ S): ZSink[Any, Nothing, A, A, S]

    Permalink

    Creates a sink that folds elements of type A 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 A 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)
     .aggregate(
       Sink
         .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). The ZSink.foldWeightedDecomposeM allows the decompose function to return a ZIO value, and consequently it allows the sink to fail.

  31. def foldWeightedDecomposeM[R, R1 <: R, E, E1 >: E, A, S](z: S)(costFn: (A) ⇒ ZIO[R, E, Long], max: Long, decompose: (A) ⇒ ZIO[R, E, Chunk[A]])(f: (S, A) ⇒ ZIO[R1, E1, S]): ZSink[R1, E1, A, A, S]

    Permalink

    Creates a sink that effectfully folds elements of type A 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 A 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. See ZSink.foldWeightedDecompose for an example.

  32. def foldWeightedM[R, R1 <: R, E, E1 >: E, A, S](z: S)(costFn: (A) ⇒ ZIO[R, E, Long], max: Long)(f: (S, A) ⇒ ZIO[R1, E1, S]): ZSink[R1, E1, A, A, S]

    Permalink

    Creates a sink that effectfully folds elements of type A 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 A 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 cause the stream to hang. See ZSink.foldWeightedDecomposeM for a variant that can handle these.

  33. def fromEffect[R, E, B](b: ⇒ ZIO[R, E, B]): ZSink[R, E, Nothing, Any, B]

    Permalink

    Creates a single-value sink produced from an effect

  34. def fromFunction[A, B](f: (A) ⇒ B): ZSink[Any, Unit, Nothing, A, B]

    Permalink

    Creates a sink that purely transforms incoming values.

  35. def fromFunctionM[R, E, A, B](f: (A) ⇒ ZIO[R, E, B]): ZSink[R, Option[E], Nothing, A, B]

    Permalink

    Creates a sink that effectfully transforms incoming values.

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

    Permalink
    Definition Classes
    AnyRef → Any
  37. def halt[E](e: ⇒ Cause[E]): ZSink[Any, E, Nothing, Any, Nothing]

    Permalink

    Creates a sink halting with a specified cause.

  38. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  39. def head[A]: ZSink[Any, Nothing, A, A, Option[A]]

    Permalink

    Creates a sink containing the first value.

  40. def identity[A]: ZSink[Any, Unit, Nothing, A, A]

    Permalink

    Creates a sink by that merely passes on incoming values.

  41. def ignoreWhile[A](p: (A) ⇒ Boolean): ZSink[Any, Nothing, A, A, Unit]

    Permalink

    Creates a sink by starts consuming value as soon as one fails the predicate p.

  42. def ignoreWhileM[R, E, A](p: (A) ⇒ ZIO[R, E, Boolean]): ZSink[R, E, A, A, Unit]

    Permalink

    Creates a sink by starts consuming value as soon as one fails the effectful predicate p.

  43. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  44. def last[A]: ZSink[Any, Nothing, Nothing, A, Option[A]]

    Permalink

    Creates a sink containing the last value.

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

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

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

    Permalink
    Definition Classes
    AnyRef
  48. def pull1[R, R1 <: R, E, A0, A, B](end: ZIO[R1, E, B])(input: (A) ⇒ ZSink[R, E, A0, A, B]): ZSink[R1, E, A0, A, B]

    Permalink

    Returns a sink that must at least perform one extraction or else will "fail" with end.

  49. def read1[E, A](e: (Option[A]) ⇒ E)(p: (A) ⇒ Boolean): ZSink[Any, E, A, A, A]

    Permalink

    Creates a sink that consumes the first value verifying the predicate p or fails as soon as the sink won't make any more progress.

  50. val splitLines: ZSink[Any, Nothing, String, String, Chunk[String]]

    Permalink

    Splits strings on newlines.

    Splits strings on newlines. Handles both \r\n and \n.

  51. val splitLinesChunk: ZSink[Any, Nothing, Chunk[String], Chunk[String], Chunk[String]]

    Permalink

    Merges chunks of strings and splits them on newlines.

    Merges chunks of strings and splits them on newlines. Handles both \r\n and \n.

  52. def splitOn(delimiter: String): ZSink[Any, Nothing, String, String, Chunk[String]]

    Permalink

    Splits strings on a delimiter.

  53. def succeed[A, B](b: ⇒ B): ZSink[Any, Nothing, A, A, B]

    Permalink

    Creates a single-value sink from a value.

  54. def sum[A](implicit ev: Numeric[A]): ZSink[Any, Nothing, Nothing, A, A]

    Permalink

    Creates a sink which sums elements, provided they are Numeric

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

    Permalink
    Definition Classes
    AnyRef
  56. def throttleEnforce[A](units: Long, duration: Duration, burst: Long = 0)(costFn: (A) ⇒ Long): ZManaged[Clock, Nothing, ZSink[Clock, Nothing, Nothing, A, Option[A]]]

    Permalink

    Creates a sink which throttles input elements of type A according to the given bandwidth parameters using the token bucket algorithm.

    Creates a sink which throttles input elements of type A according to the given bandwidth parameters using the token bucket algorithm. The sink allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. Elements that do not meet the bandwidth constraints are dropped. The weight of each element is determined by the costFn function. Elements are mapped to Option[A], and None denotes that a given element has been dropped.

  57. def throttleEnforceM[R, E, A](units: Long, duration: Duration, burst: Long = 0)(costFn: (A) ⇒ ZIO[R, E, Long]): ZManaged[Clock, Nothing, ZSink[R with Clock, E, Nothing, A, Option[A]]]

    Permalink

    Creates a sink which throttles input elements of type A according to the given bandwidth parameters using the token bucket algorithm.

    Creates a sink which throttles input elements of type A according to the given bandwidth parameters using the token bucket algorithm. The sink allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. Elements that do not meet the bandwidth constraints are dropped. The weight of each element is determined by the costFn effectful function. Elements are mapped to Option[A], and None denotes that a given element has been dropped.

  58. def throttleShape[A](units: Long, duration: Duration, burst: Long = 0)(costFn: (A) ⇒ Long): ZManaged[Clock, Nothing, ZSink[Clock, Nothing, Nothing, A, A]]

    Permalink

    Creates a sink which delays input elements of type A according to the given bandwidth parameters using the token bucket algorithm.

    Creates a sink which delays input elements of type A according to the given bandwidth parameters using the token bucket algorithm. The sink allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. The weight of each element is determined by the costFn function.

  59. def throttleShapeM[R, E, A](units: Long, duration: Duration, burst: Long = 0)(costFn: (A) ⇒ ZIO[R, E, Long]): ZManaged[Clock, Nothing, ZSink[R with Clock, E, Nothing, A, A]]

    Permalink

    Creates a sink which delays input elements of type A according to the given bandwidth parameters using the token bucket algorithm.

    Creates a sink which delays input elements of type A according to the given bandwidth parameters using the token bucket algorithm. The sink allows for burst in the processing of elements by allowing the token bucket to accumulate tokens up to a units + burst threshold. The weight of each element is determined by the costFn effectful function.

  60. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  61. val utf8DecodeChunk: ZSink[Any, Nothing, Chunk[Byte], Chunk[Byte], String]

    Permalink

    Decodes chunks of bytes into a String.

    Decodes chunks of bytes into a String.

    This sink uses the String constructor's behavior when handling malformed byte sequences.

  62. final def wait(): Unit

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

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

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

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped