_process

trait _process[A]
class java.lang.Object
trait scala.Matchable
class Any
trait _use
object Stream

Def

inline def drain: Unit

Pump stream out

Pump stream out

Fetches and discards all stream elements

This operation can be usefull for side effects built into streaming pipeline

 ('A' <> 'C').stream.peek(_.tp).drain

 // Output
 A
 B
 C
Source
_process.scala
inline def foreach[U](f: A => U): Unit

Process stream

Process stream

Applies given function to each stream element

 ('A' <> 'C').stream.foreach(_.tp)

 // Output
 A
 B
 C
Source
_process.scala
inline def FOREACH[U](f: A => U): Unit

Heavy process stream

Heavy process stream

Applies given function to each stream element

FOREACH is functionally equivalent to foreach, but is fully inlined. It makes compiled code larger, but guarantees the best possible performance on large streams.

Source
_process.scala
inline def foreachIndexed[U](f: (Int, A) => U, start: Int): Unit

For each indexed

For each indexed

Calls given function with counter

 ('A' <> 'C').stream.foreachIndexed((i,v) => "Element " + i + " = " + v tp(), 1)

 // Output
 Element 1 = A
 Element 2 = B
 Element 3 = C
Value Params
start

starting value for indexing

Source
_process.scala
inline def fornil[U](f: => U): Unit

Run for nonexistent value

Run for nonexistent value

Runs given function only if stream is empty.

This operation is rarely useful and is provided for consistency.

Use peekEmpty instead, it can be combined with other processing

Source
_process.scala
inline def process[U,W](foreachFun: A => U, fornilFun: => W): Unit

Process elements or empty case

Process elements or empty case

Applies given function to each stream element or runs second function when stream is empty

 ('A' <>> 'A').stream.process(_.tp, "Empty".tp)

 // Output
 Empty
Source
_process.scala