Stream.Custom.Pipeline.ParallelFlow

abstract class ParallelFlow[A] extends Stream.Flow[A] with Stream.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 Stream.Flow[Stream.Custom.Pipeline.ParallelFlow.A]
trait _metadata[Stream.Custom.Pipeline.ParallelFlow.A]
trait _use[Stream.Custom.Pipeline.ParallelFlow.A]
trait _build[Stream.Custom.Pipeline.ParallelFlow.A]
class java.lang.Object
trait scala.Matchable
class Any

Def

def collect[B](f: scala.PartialFunction[A, B]): Stream.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
Inherited from
Tree
Source
__.scala
def drain: Unit
def drop(f: A => Boolean): Stream.Flow[A]

Reverse filter

Reverse filter

Disallows Stream.Flow elements satisfying the given function

Inherited from
_build
Source
_build.scala
def exists(f: A => Boolean): Boolean
def find(f: A => Boolean): A
def findAnyOpt: 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 findOpt(f: A => Boolean): Opt[A]
def flatMap[B](f: A => Stream[B]): Stream.Flow[B]

Flat map

Flat map

Creates a new Stream.Flow by applying given function to all elements of current Stream.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
def isEvery(f: A => Boolean): Boolean
def isParallel: Boolean
def map[B](f: A => B): Stream.Flow[B]

Simple map

Simple map

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

Inherited from
_build
Source
_build.scala
def mapOpt[B](f: A => Opt[B]): Stream.Flow[B]
def max(using o: Ordering[A]): A
def maxBy[B](f: A => B)(using o: Ordering[B]): A
def maxByOpt[B](f: A => B)(using o: Ordering[B]): Opt[A]
def maxOpt(using o: Ordering[A]): Opt[A]
def min(using o: Ordering[A]): A
def minBy[B](f: A => B)(using o: Ordering[B]): A
def minByOpt[B](f: A => B)(using o: Ordering[B]): Opt[A]
def minOpt(using o: Ordering[A]): Opt[A]
def name: String
def peek(c: A => Unit): Stream.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): Stream.Flow[A]
def process[U, W](f: A => U, fornil: => W): Unit
def range(using o: Ordering[A]): Range[A]
def rangeOpt(using o: Ordering[A]): Opt[Range[A]]
def reduce(bf: (A, A) => A): A
def reduceOpt(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

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.toLong).stream

s.sizeLongOpt.tp    // Prints Long.Opt(4294967296)

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

s.sizeLongOpt.tp    // Prints Long.Opt(VOID)
Inherited from
_metadata
Source
_metadata.scala

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 sizeLongOpt

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

 s.sizeOpt.tp         // Prints Int.Opt(26)

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

 s.sizeOpt.tp         // Prints Int.Opt(VOID)
Inherited from
_metadata
Source
_metadata.scala
def sum(using m: Math.Sum[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): Stream.Flow[A]

Filter

Filter

Only allow Stream.Flow elements satisfying the given function

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