~~.Custom.Pipeline.ParallelFlow

abstract class ParallelFlow[A] extends ~~.Flow[A] with ~~.Custom.Pipeline.Tree

This is a base for parallel Flow implementations

In Scalqa it is allowed to setup custom parallel calculations engine, and this class is reccomended way to start

Source
ParallelFlow.scala
trait Able.Doc
trait Able.Tag
class ~~.Flow[A]
trait _metadata[A]
trait _use[A]
trait _build[A]
class java.lang.Object
trait scala.Matchable
class Any

Def

@scala.annotation.targetName("stream")
def ~: ~[A]
def collect[B](f: scala.PartialFunction[A, B]): ~~.Flow[B]
def contains[B >: A](value: B): Boolean
def count: Int

All count

All count

Counts all flow elements

Inherited from
_use
Source
_use.scala
def doc: Doc
Inherited from
Tree
Source
__.scala

Tree description

Tree description

Returns a tree describing all flow trasformations

 ('a' <> 'z').~
    .take(_ > 'X')
    .map(_.toUpper)
    .parallel
    .docTree.tp

 // Output
  scalqa.val.stream.z.flow.parallel.Flow_asJavaStream@ncwo{}
    scalqa.lang.char.g.stream.z.map$Chars@uru4{raw=Char,fromRaw=Char}
      scalqa.lang.char.g.Stream$TakeStream$2@56u4{raw=Char,fromRaw=Char}
        scalqa.lang.char.g.stream.Z$Stream_fromRange@cq06{raw=Char,size=26,from=a,step=1}
Inherited from
_metadata
Source
_metadata.scala
def drain: Unit
def drop(f: A => Boolean): ~~.Flow[A]

Reverse filter

Reverse filter

Disallows ~~.Flow elements satisfying the given function

Inherited from
_build
Source
_build.scala
def exists(f: A => Boolean): Boolean
def find(f: A => Boolean): A
@scala.annotation.targetName("find_Opt")
def find_?(f: A => Boolean): Opt[A]
@scala.annotation.targetName("findAny_Opt")
def findAny_?: Opt[A]

Find optional any value

Find optional any value

Finds any value or returns void option if not found

Inherited from
_use
Source
_use.scala
def flatMap[B](f: A => ~[B]): ~~.Flow[B]

Flat map

Flat map

Creates a new ~~.Flow by applying given function to all elements of current ~~.Flow and concatenating the results

Inherited from
_build
Source
_build.scala
def fold(start: A)(bf: (A, A) => A): A
def foldAs[B](start: B)(bf: (B, A) => B, cf: (B, B) => B): B

Fold and convert

Fold and convert

Folds and converts elements with a binary function

Value Params
f

binary function to fold elements with

start

seed value to start with

Inherited from
_use
Source
_use.scala
def foreach[U](f: A => U): Unit

Process flow

Process flow

Applies given function to each flow element

Inherited from
_use
Source
_use.scala
Inherited from
Tree
Source
__.scala
def isEvery(f: A => Boolean): Boolean
def isParallel: Boolean
def map[B](f: A => B): ~~.Flow[B]

Simple map

Simple map

Creates a new ~~.Flow where each element is a result of applying given function to current ~~.Flow elements

Inherited from
_build
Source
_build.scala
@scala.annotation.targetName("map_Opt")
def map_?[B](f: A => Opt[B]): ~~.Flow[B]
def max(using o: scala.Ordering[A]): A
@scala.annotation.targetName("max_Opt")
def max_?(using o: scala.Ordering[A]): Opt[A]
def maxBy[B](f: A => B)(using o: scala.Ordering[B]): A
@scala.annotation.targetName("maxBy_Opt")
def maxBy_?[B](f: A => B)(using o: scala.Ordering[B]): Opt[A]
def min(using o: scala.Ordering[A]): A
@scala.annotation.targetName("min_Opt")
def min_?(using o: scala.Ordering[A]): Opt[A]
def minBy[B](f: A => B)(using o: scala.Ordering[B]): A
@scala.annotation.targetName("minBy_Opt")
def minBy_?[B](f: A => B)(using o: scala.Ordering[B]): Opt[A]
def name: String
def peek(c: A => Unit): ~~.Flow[A]

Inspect

Inspect

The given function will be run for every passing stream flow element.

Inherited from
_build
Source
_build.scala
def peekIndexed[U](f: (Int, A) => U, start: Int): ~~.Flow[A]
def process[U, W](f: A => U, fornil: => W): Unit
def range(using o: scala.Ordering[A]): <>[A]
@scala.annotation.targetName("range_Opt")
def range_?(using o: scala.Ordering[A]): Opt[<>[A]]
def reduce(bf: (A, A) => A): A
@scala.annotation.targetName("reduce_Opt")
def reduce_?(bf: (A, A) => A): Opt[A]

Optional reduce

Optional reduce

Folds elements with a binary function or returns empty option when stream is empty

Value Params
f

binary function to fold elements with

Inherited from
_use
Source
_use.scala
@scala.annotation.targetName("size_Opt")

Optional size

Optional size

Many streams can return their current element count. If the information is not available, void option is returned

Note: If size is known, but exceeds integer range, void option is returned. For theses cases use sizeLong_?

 var s = ('a' <> 'z').~

 s.size_?.tp         // Prints Int.Opt(26)

 s = s.take(_ > 10)  // static sizing is lost

 s.size_?.tp         // Prints Int.Opt(\/)
Inherited from
_metadata
Source
_metadata.scala
@scala.annotation.targetName("sizeLong_Opt")

Optional long size

Optional long size

Many streams can return their current element count. If the information is not available, void option is returned

var s = (Int.min.Long <> Int.max.Long).~

s.sizeLong_?.tp    // Prints Long.Opt(4294967296)

s = s.take(_ > 10) // static sizing is lost

s.sizeLong_?.tp    // Prints Long.Opt(\/)
Inherited from
_metadata
Source
_metadata.scala
def sum(using m: scala.math.Numeric[A]): A
def tag: String

Make String

Make String

tag returns this instance String representation, which should be used insted of toString

Inherited from
Doc
Source
Doc.scala
def take(f: A => Boolean): ~~.Flow[A]

Filter

Filter

Only allow ~~.Flow elements satisfying the given function

Inherited from
_build
Source
_build.scala
def takeType[B](using t: scala.reflect.ClassTag[B]): ~~.Flow[B]