Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PipelineEngine

Abstract representation used to apply transformations on a pipeline of iterators. Concrete subclasses are used by the framework to build the query execution pipeline.

abstract
author

Thomas Minier

Hierarchy

Index

Methods

Abstract bufferCount

  • Buffers the source PipelineStage values until the size hits the maximum bufferSize given.

    Type parameters

    • T

    Parameters

    • input: PipelineStage<T>

      Input PipelineStage

    • count: number

      The maximum size of the buffer emitted.

    Returns PipelineStage<T[]>

    A PipelineStage of arrays of buffered values.

Abstract catch

  • Handle errors raised in the pipeline as follows:

    1) Default: raise the error 2) Use a handler function to returns a new PipelineStage in case of error

    Type parameters

    • T

    • O

    Parameters

    • input: PipelineStage<T>

      Source PipelineStage

    • Optional handler: undefined | function

      Function called in case of error to generate a new PipelineStage

    Returns PipelineStage<T | O>

    Output PipelineStage

Abstract clone

Abstract collect

  • Creates a PipelineStage which collect all items from the source PipelineStage into an array, and then emits this array.

    Type parameters

    • T

    Parameters

    Returns PipelineStage<T[]>

    A PipelineStage which emits all values emitted by the source PipelineStage as an array

Abstract defaultValues

  • Emits given values if the source PipelineStage completes without emitting any next value, otherwise mirrors the source PipelineStage.

    Type parameters

    • T

    Parameters

    • input: PipelineStage<T>

      Input PipelineStage

    • Rest ...values: T[]

    Returns PipelineStage<T>

    A PipelineStage that emits either the specified default values if the source PipelineStage emits no items, or the values emitted by the source PipelineStage.

distinct

  • Returns a PipelineStage that emits all items emitted by the source PipelineStage that are distinct by comparison from previous items.

    Type parameters

    • T

    • K

    Parameters

    • input: PipelineStage<T>

      Input PipelineStage

    • Optional selector: undefined | function

      Optional function to select which value you want to check as distinct.

    Returns PipelineStage<T>

    A PipelineStage that emits items from the source PipelineStage with distinct values.

Abstract empty

endWith

  • Returns a PipelineStage that emits the items you specify as arguments after it finishes emitting items emitted by the source PipelineStage.

    Type parameters

    • T

    Parameters

    • input: PipelineStage<T>

      Input PipelineStage

    • values: T[]

      Values to append

    Returns PipelineStage<T>

    A PipelineStage that emits the items emitted by the source PipelineStage and then emits the additional values.

Abstract filter

  • Filter items emitted by the source PipelineStage by only emitting those that satisfy a specified predicate.

    Type parameters

    • T

    Parameters

    • input: PipelineStage<T>

      Input PipelineStage

    • predicate: function

      Predicate function

        • (value: T): boolean
        • Parameters

          • value: T

          Returns boolean

    Returns PipelineStage<T>

    Output PipelineStage

Abstract finalize

  • Do something after the PipelineStage has produced all its results

    Type parameters

    • T

    Parameters

    • input: PipelineStage<T>

      Input PipelineStage

    • callback: function

      Function invoked after the PipelineStage has produced all its results

        • (): void
        • Returns void

    Returns PipelineStage<T>

    Output PipelineStage

first

flatMap

  • Maps each source value to an array of values which is merged in the output PipelineStage.

    Type parameters

    • F

    • T

    Parameters

    • input: PipelineStage<F>

      Input PipelineStage

    • mapper: function

      Transformation function

        • (value: F): T[]
        • Parameters

          • value: F

          Returns T[]

    Returns PipelineStage<T>

    Output PipelineStage

flatten

Abstract forEach

  • Apply a callback on every item emitted by the source PipelineStage

    Type parameters

    • T

    Parameters

    • input: PipelineStage<T>

      Input PipelineStage

    • cb: function

      Callback

        • (value: T): void
        • Parameters

          • value: T

          Returns void

    Returns void

Abstract from

Abstract fromAsync

groupBy

  • groupBy<T, K, R>(input: PipelineStage<T>, keySelector: function, elementSelector?: undefined | function): PipelineStage<[K, R[]]>
  • Groups the items produced by a pipeline according to a specified criterion, and emits the resulting groups

    Type parameters

    • T

    • K

    • R

    Parameters

    • input: PipelineStage<T>

      Input PipelineStage

    • keySelector: function

      A function that extracts the grouping key for each item

        • (value: T): K
        • Parameters

          • value: T

          Returns K

    • Optional elementSelector: undefined | function

      (optional) A function that transforms items before inserting them in a group

    Returns PipelineStage<[K, R[]]>

Abstract limit

  • Emits only the first count values emitted by the source PipelineStage.

    Type parameters

    • T

    Parameters

    • input: PipelineStage<T>

      Input PipelineStage

    • count: number

      How many items to take

    Returns PipelineStage<T>

    A PipelineStage that emits only the first count values emitted by the source PipelineStage, or all of the values from the source if the source emits fewer than count values.

Abstract map

  • Applies a given mapper function to each value emitted by the source PipelineStage, and emits the resulting values as a PipelineStage.

    Type parameters

    • F

    • T

    Parameters

    • input: PipelineStage<F>

      Source PipelineStage

    • mapper: function

      The function to apply to each value emitted by the source PipelineStage

        • (value: F): T
        • Parameters

          • value: F

          Returns T

    Returns PipelineStage<T>

    A PipelineStage that emits the values from the source PipelineStage transformed by the given mapper function.

max

  • Find the smallest value produced by a pipeline of iterators. It takes a ranking function as input, which is invoked with (x, y) and must returns True if x > y and False otherwise. Warning: this function needs to materialize all values of the pipeline.

    Type parameters

    • T

    Parameters

    • input: PipelineStage<T>

      Input PipelineStage

    • Optional ranking: undefined | function

    Returns PipelineStage<T>

    A pipeline stage that emits the highest value found

Abstract merge

Abstract mergeMap

min

  • Find the smallest value produced by a pipeline of iterators. It takes a ranking function as input, which is invoked with (x, y) and must returns True if x < y and False otherwise. Warning: this function needs to materialize all values of the pipeline.

    Type parameters

    • T

    Parameters

    • input: PipelineStage<T>

      Input PipelineStage

    • Optional ranking: undefined | function

    Returns PipelineStage<T>

    A pipeline stage that emits the lowest value found

Abstract of

peekIf

  • peekIf<T, O>(input: PipelineStage<T>, count: number, predicate: function, ifCase: function, elseCase: function): PipelineStage<O>
  • Peek values from the input pipeline stage, and use them to decide between two candidate pipeline stages to continue the pipeline.

    Type parameters

    • T

    • O

    Parameters

    • input: PipelineStage<T>

      Input pipeline stage

    • count: number

      How many items to peek from the input?

    • predicate: function

      Predicate function invoked with the values

        • (values: T[]): boolean
        • Parameters

          • values: T[]

          Returns boolean

    • ifCase: function

      Callback invoked if the predicate function evaluates to True

    • elseCase: function

      Callback invoked if the predicate function evaluates to False

    Returns PipelineStage<O>

    A pipeline stage

Abstract reduce

  • Applies an accumulator function over the source PipelineStage, and returns the accumulated result when the source completes, given an optional initial value.

    Type parameters

    • F

    • T

    Parameters

    • input: PipelineStage<F>

      Input PipelineStage

    • reducer: function

      Accumulator function

        • (acc: T, value: F): T
        • Parameters

          • acc: T
          • value: F

          Returns T

    • initial: T

    Returns PipelineStage<T>

    A PipelineStage that emits a single value that is the result of accumulating the values emitted by the source PipelineStage.

Abstract skip

  • Returns a PipelineStage that skips the first count items emitted by the source PipelineStage.

    Type parameters

    • T

    Parameters

    • input: PipelineStage<T>

      Input PipelineStage

    • count: number

      How many items to skip

    Returns PipelineStage<T>

    A PipelineStage that skips values emitted by the source PipelineStage.

tap

  • Perform a side effect for every emission on the source PipelineStage, but return a PipelineStage that is identical to the source.

    Type parameters

    • T

    Parameters

    • input: PipelineStage<T>

      Input PipelineStage

    • cb: function

      Callback invoked on each item

        • (value: T): void
        • Parameters

          • value: T

          Returns void

    Returns PipelineStage<T>

    A PipelineStage identical to the source, but runs the specified PipelineStage or callback(s) for each item.

Generated using TypeDoc