Packages

object ZTransducer extends ZTransducerPlatformSpecificConstructors

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZTransducer
  2. ZTransducerPlatformSpecificConstructors
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply[I]: ZTransducer[Any, Nothing, I, I]

    Shorthand form for ZTransducer.identity.

    Shorthand form for ZTransducer.identity. Use as:

    ZTransducer[Int].filter(_ % 2 != 0)
  5. def apply[R, E, I, O](push: ZManaged[R, Nothing, (Option[Chunk[I]]) => ZIO[R, E, Chunk[O]]]): ZTransducer[R, E, I, O]
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def branchAfter[R, E, I, O](n: Int)(f: (Chunk[I]) => ZTransducer[R, E, I, O])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

    Reads the first n values from the stream and uses them to choose the transducer that will be used for the remainder of the stream.

    Reads the first n values from the stream and uses them to choose the transducer that will be used for the remainder of the stream. If the stream ends before it has collected n values the partial chunk will be provided to f.

  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def collectAllN[I](n: Int)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, I, Chunk[I]]

    Creates a transducer accumulating incoming values into chunks of maximum size n.

  10. def collectAllToMapN[K, I](n: Long)(key: (I) => K)(f: (I, I) => I)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, I, Map[K, I]]

    Creates a transducer accumulating incoming values into maps of up to n keys.

    Creates a transducer accumulating incoming values into maps of up to n keys. Elements are mapped to keys using the function key; elements mapped to the same key will be merged with the function f.

  11. def collectAllToSetN[I](n: Long)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, I, Set[I]]

    Creates a transducer accumulating incoming values into sets of maximum size n.

  12. def collectAllWhile[I](p: (I) => Boolean)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, I, List[I]]

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

  13. def collectAllWhileZIO[R, E, I](p: (I) => ZIO[R, E, Boolean])(implicit trace: ZTraceElement): ZTransducer[R, E, I, List[I]]

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

  14. def deflate(bufferSize: Int = 64 * 1024, noWrap: Boolean = false, level: CompressionLevel = CompressionLevel.DefaultCompression, strategy: CompressionStrategy = CompressionStrategy.DefaultStrategy, flushMode: FlushMode = FlushMode.NoFlush)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, Byte, Byte]

    Compresses stream with 'deflate' method described in https://tools.ietf.org/html/rfc1951.

    Compresses stream with 'deflate' method described in https://tools.ietf.org/html/rfc1951. Each incoming chunk is compressed at once, so it can utilize thread for long time if chunks are big.

    bufferSize

    Size of internal buffer used for pulling data from deflater, affects performance.

    noWrap

    Whether output stream is wrapped in ZLIB header and trailer. For HTTP 'deflate' content-encoding should be false, see https://tools.ietf.org/html/rfc2616.

    Definition Classes
    ZTransducerPlatformSpecificConstructors
  15. def die(e: => Throwable)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, Any, Nothing]

    Creates a transducer that always dies with the specified exception.

  16. def dropWhile[I](p: (I) => Boolean)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, I, I]

    Creates a transducer that starts consuming values as soon as one fails the predicate p.

  17. def dropWhileZIO[R, E, I](p: (I) => ZIO[R, E, Boolean])(implicit trace: ZTraceElement): ZTransducer[R, E, I, I]

    Creates a transducer that starts consuming values as soon as one fails the effectful predicate p.

  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  20. def fail[E](e: => E)(implicit trace: ZTraceElement): ZTransducer[Any, E, Any, Nothing]

    Creates a transducer that always fails with the specified failure.

  21. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  22. def fold[I, O](z: O)(contFn: (O) => Boolean)(f: (O, I) => O)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, I, O]

    Creates a transducer by folding over a structure of type O for as long as contFn results in true.

    Creates a transducer by folding over a structure of type O for as long as contFn results in true. The transducer will emit a value when contFn evaluates to false and then restart the folding.

  23. def foldLeft[I, O](z: O)(f: (O, I) => O)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, I, O]

    Creates a transducer by folding over a structure of type O.

    Creates a transducer by folding over a structure of type O. The transducer will fold the inputs until the stream ends, resulting in a stream with one element.

  24. def foldLeftZIO[R, E, I, O](z: O)(f: (O, I) => ZIO[R, E, O])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

    Creates a transducer by effectfully folding over a structure of type O.

    Creates a transducer by effectfully folding over a structure of type O. The transducer will fold the inputs until the stream ends, resulting in a stream with one element.

  25. def foldUntil[I, O](z: O, max: Long)(f: (O, I) => O)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, I, O]

    Creates a transducer that folds elements of type I into a structure of type O until max elements have been folded.

    Creates a transducer that folds elements of type I into a structure of type O until max elements have been folded.

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

  26. def foldUntilZIO[R, E, I, O](z: O, max: Long)(f: (O, I) => ZIO[R, E, O])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

    Creates a transducer that effectfully folds elements of type I into a structure of type O until max elements have been folded.

    Creates a transducer that effectfully folds elements of type I into a structure of type O until max elements have been folded.

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

  27. def foldWeighted[I, O](z: O)(costFn: (O, I) => Long, max: Long)(f: (O, I) => O)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, I, O]

    Creates a transducer that folds elements of type I into a structure of type O, until max worth of elements (determined by the costFn) have been folded.

    Creates a transducer that folds elements of type I into a structure of type O, 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 transducer to cross the max cost. See foldWeightedDecompose for a variant that can handle these cases.

  28. def foldWeightedDecompose[I, O](z: O)(costFn: (O, I) => Long, max: Long, decompose: (I) => Chunk[I])(f: (O, I) => O)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, I, O]

    Creates a transducer that folds elements of type I into a structure of type O, until max worth of elements (determined by the costFn) have been folded.

    Creates a transducer that folds elements of type I into a structure of type O, until max worth of elements (determined by the costFn) have been folded.

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

    Stream(1, 5, 1)
     .aggregate(
       ZTransducer
         .foldWeightedDecompose(List[Int]())((_, i: Int) => i.toLong, 4,
           (i: Int) => if (i > 1) Chunk(i - 1, 1) else Chunk(i)) { (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 transducer to fail.

  29. def foldWeightedDecomposeZIO[R, E, I, O](z: O)(costFn: (O, I) => ZIO[R, E, Long], max: Long, decompose: (I) => ZIO[R, E, Chunk[I]])(f: (O, I) => ZIO[R, E, O])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

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

    Creates a transducer that effectfully folds elements of type I 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.

  30. def foldWeightedZIO[R, E, I, O](z: O)(costFn: (O, I) => ZIO[R, E, Long], max: Long)(f: (O, I) => ZIO[R, E, O])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

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

    Creates a transducer that effectfully folds elements of type I 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 transducer to cross the max cost. See foldWeightedDecomposeM for a variant that can handle these cases.

  31. def foldZIO[R, E, I, O](z: O)(contFn: (O) => Boolean)(f: (O, I) => ZIO[R, E, O])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

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

  32. def fromFunction[I, O](f: (I) => O)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, I, O]

    Creates a transducer that purely transforms incoming values.

  33. def fromFunctionZIO[R, E, I, O](f: (I) => ZIO[R, E, O])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

    Creates a transducer that effectfully transforms incoming values.

  34. def fromPush[R, E, I, O](push: (Option[Chunk[I]]) => ZIO[R, E, Chunk[O]])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

    Creates a transducer from a chunk processing function.

  35. def fromZIO[R, E, A](zio: ZIO[R, E, A])(implicit trace: ZTraceElement): ZTransducer[R, E, Any, A]

    Creates a transducer that always evaluates the specified effect.

  36. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  37. def groupAdjacentBy[I, K](f: (I) => K)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, I, (K, NonEmptyChunk[I])]

    Creates a transducer that groups on adjacent keys, calculated by function f.
    With this transducer we can mimic fs2 groupAdjacentBy.
    This can be used like e.g.

    Creates a transducer that groups on adjacent keys, calculated by function f.
    With this transducer we can mimic fs2 groupAdjacentBy.
    This can be used like e.g. zstream.aggregate(groupAdjacentBy(_._1))

  38. def gunzip(bufferSize: Int = 64 * 1024)(implicit trace: ZTraceElement): ZTransducer[Any, CompressionException, Byte, Byte]

    Decompresses gzipped stream.

    Decompresses gzipped stream. Compression method is described in https://tools.ietf.org/html/rfc1952.

    bufferSize

    Size of buffer used internally, affects performance.

    Definition Classes
    ZTransducerPlatformSpecificConstructors
  39. def gzip(bufferSize: Int = 64 * 1024, level: CompressionLevel = CompressionLevel.DefaultCompression, strategy: CompressionStrategy = CompressionStrategy.DefaultStrategy, flushMode: FlushMode = FlushMode.NoFlush)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, Byte, Byte]

    bufferSize

    Size of buffer used internally, affects performance.

    Definition Classes
    ZTransducerPlatformSpecificConstructors
  40. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  41. def head[O](implicit trace: ZTraceElement): ZTransducer[Any, Nothing, O, Option[O]]

    Creates a transducer that returns the first element of the stream, if it exists.

  42. def identity[I](implicit trace: ZTraceElement): ZTransducer[Any, Nothing, I, I]

    The identity transducer.

    The identity transducer. Passes elements through.

  43. def inflate(bufferSize: Int = 64 * 1024, noWrap: Boolean = false)(implicit trace: ZTraceElement): ZTransducer[Any, CompressionException, Byte, Byte]

    Decompresses deflated stream.

    Decompresses deflated stream. Compression method is described in https://tools.ietf.org/html/rfc1951.

    bufferSize

    Size of buffer used internally, affects performance.

    noWrap

    Whether is wrapped in ZLIB header and trailer, see https://tools.ietf.org/html/rfc1951. For HTTP 'deflate' content-encoding should be false, see https://tools.ietf.org/html/rfc2616.

    Definition Classes
    ZTransducerPlatformSpecificConstructors
  44. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  45. def iso_8859_1Decode(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, Byte, String]

    Decodes chunks of ISO/IEC 8859-1 bytes into strings.

    Decodes chunks of ISO/IEC 8859-1 bytes into strings.

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

  46. def last[O](implicit trace: ZTraceElement): ZTransducer[Any, Nothing, O, Option[O]]

    Creates a transducer that returns the last element of the stream, if it exists.

  47. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  48. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  49. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  50. def prepend[A](values: Chunk[A])(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, A, A]

    Emits the provided chunk before emitting any other value.

  51. def splitLines(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, String, String]

    Splits strings on newlines.

    Splits strings on newlines. Handles both Windows newlines (\r\n) and UNIX newlines (\n).

  52. def splitOn(delimiter: String)(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, String, String]

    Splits strings on a delimiter.

  53. def splitOnChunk[A](delimiter: Chunk[A])(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, A, Chunk[A]]

    Splits elements on a delimiter and transforms the splits into desired output.

  54. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  55. def toString(): String
    Definition Classes
    AnyRef → Any
  56. def unwrap[R, E, I, O](zio: ZIO[R, E, ZTransducer[R, E, I, O]])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

    Creates a transducer produced from an effect.

  57. def unwrapManaged[R, E, I, O](managed: ZManaged[R, E, ZTransducer[R, E, I, O]])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

    Creates a transducer produced from a managed effect.

  58. def usASCIIDecode(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, Byte, String]

    Decodes chunks of US-ASCII bytes into strings.

    Decodes chunks of US-ASCII bytes into strings.

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

  59. def utf16BEDecode(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, Byte, String]

    Decodes chunks of UTF-16BE bytes into strings.

    Decodes chunks of UTF-16BE bytes into strings.

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

  60. def utf16Decode(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, Byte, String]

    Decodes chunks of UTF-16 bytes into strings.

    Decodes chunks of UTF-16 bytes into strings. If no byte order mark is found big-endianness is assumed.

    This transducer uses the endisn-specific String constructor's behavior when handling malformed byte sequences.

  61. def utf16LEDecode(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, Byte, String]

    Decodes chunks of UTF-16LE bytes into strings.

    Decodes chunks of UTF-16LE bytes into strings.

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

  62. def utf32BEDecode(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, Byte, String]

    Decodes chunks of UTF-32BE bytes into strings.

    Decodes chunks of UTF-32BE bytes into strings.

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

  63. def utf32Decode(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, Byte, String]

    Decodes chunks of UTF-32 bytes into strings.

    Decodes chunks of UTF-32 bytes into strings. If no byte order mark is found big-endianness is assumed.

  64. def utf32LEDecode(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, Byte, String]

    Decodes chunks of UTF-32LE bytes into strings.

    Decodes chunks of UTF-32LE bytes into strings.

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

  65. def utf8Decode(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, Byte, String]

    Decodes chunks of UTF-8 bytes into strings.

    Decodes chunks of UTF-8 bytes into strings.

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

  66. def utfDecode(implicit trace: ZTraceElement): ZTransducer[Any, Nothing, Byte, String]

    Decodes chunks of Unicode bytes into strings.

    Decodes chunks of Unicode bytes into strings.

    Detects byte order marks for UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE or defaults to UTF-8 if no BOM is detected.

  67. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  68. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  69. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  70. object Push

Deprecated Value Members

  1. def collectAllWhileM[R, E, I](p: (I) => ZIO[R, E, Boolean])(implicit trace: ZTraceElement): ZTransducer[R, E, I, List[I]]

    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, E, I](p: (I) => ZIO[R, E, Boolean])(implicit trace: ZTraceElement): ZTransducer[R, E, I, I]

    Creates a transducer that starts consuming values as soon as one fails the effectful predicate p.

    Creates a transducer that starts consuming values as soon as one fails the effectful predicate p.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use dropWhileZIO

  3. def foldLeftM[R, E, I, O](z: O)(f: (O, I) => ZIO[R, E, O])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

    Creates a transducer by effectfully folding over a structure of type O.

    Creates a transducer by effectfully folding over a structure of type O. The transducer will fold the inputs until the stream ends, resulting in a stream with one element.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use foldLeftZIO

  4. def foldM[R, E, I, O](z: O)(contFn: (O) => Boolean)(f: (O, I) => ZIO[R, E, O])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

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

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

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use foldZIO

  5. def foldUntilM[R, E, I, O](z: O, max: Long)(f: (O, I) => ZIO[R, E, O])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

    Creates a transducer that effectfully folds elements of type I into a structure of type O until max elements have been folded.

    Creates a transducer that effectfully folds elements of type I into a structure of type O 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

  6. def foldWeightedDecomposeM[R, E, I, O](z: O)(costFn: (O, I) => ZIO[R, E, Long], max: Long, decompose: (I) => ZIO[R, E, Chunk[I]])(f: (O, I) => ZIO[R, E, O])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

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

    Creates a transducer that effectfully folds elements of type I 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

  7. def foldWeightedM[R, E, I, O](z: O)(costFn: (O, I) => ZIO[R, E, Long], max: Long)(f: (O, I) => ZIO[R, E, O])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

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

    Creates a transducer that effectfully folds elements of type I 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 transducer to cross the max cost. See foldWeightedDecomposeM for a variant that can handle these cases.

  8. def fromEffect[R, E, A](zio: ZIO[R, E, A])(implicit trace: ZTraceElement): ZTransducer[R, E, Any, A]

    Creates a transducer that always evaluates the specified effect.

    Creates a transducer that always evaluates the specified effect.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use fromZIO

  9. def fromFunctionM[R, E, I, O](f: (I) => ZIO[R, E, O])(implicit trace: ZTraceElement): ZTransducer[R, E, I, O]

    Creates a transducer that effectfully transforms incoming values.

    Creates a transducer that effectfully transforms incoming values.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use fromFunctionZIO

Inherited from AnyRef

Inherited from Any

Ungrouped