_process

trait _process
class java.lang.Object
trait scala.Matchable
class Any
trait _use
object ~

Def

def drain[A]: 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').~.peek(_.tp).drain

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

Process stream

Process stream

Applies given function to each stream element

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

 // Output
 A
 B
 C
Source
_process.scala
inline def FOREACH[A](inline 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
def foreachIndexed[A](f: (Int, A) => U, start: Int): Unit

For each indexed

For each indexed

Calls given function with counter

 ('A' <> 'C').~.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
def fornil[A](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
def process[A](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').~.process(_.tp, "Empty".tp)

 // Output
 Empty
Source
_process.scala