Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ParallelChainImpl<TIn, TEnv, TOut>

Implementation of a IParallelChain

The implementation uses an internal state (IParallelChainState) to distinguishes between a not yet scheduled job (PendingParallelChainState), a job that has been scheduled but potentially not yet completed (ScheduledParallelChainState) and a job that is waiting for another one to complete, but has not yet been scheduled (DependentParallelChainState).

Type parameters

  • TIn

    type of the elements created by the generator

  • TEnv: IParallelEnvironment

    type of the job environment

  • TOut

    type of the elements in the resulting array

Hierarchy

  • ParallelChainImpl

Implements

Index

Constructors

constructor

Properties

state

state: IParallelChainState<TOut>

Methods

Private _chain

catch

  • catch<TResult>(onrejected: function): Promise<TResult | TOut[]>
  • catch(onrejected: function): Promise<TOut[]>
  • Type parameters

    • TResult

    Parameters

    • onrejected: function
        • (reason: any): TResult | PromiseLike<TResult>
        • Parameters

          • reason: any

          Returns TResult | PromiseLike<TResult>

    Returns Promise<TResult | TOut[]>

  • Parameters

    • onrejected: function
        • (reason: any): Array<TOut> | PromiseLike<Array<TOut>>
        • Parameters

          • reason: any

          Returns Array<TOut> | PromiseLike<Array<TOut>>

    Returns Promise<TOut[]>

filter

inEnvironment

map

reduce

  • reduce<TResult>(defaultValue: TResult, accumulator: function | IFunctionId, combiner?: undefined | function): IParallelStream<TResult[], TResult>

Private resolveChain

subscribe

  • subscribe(onNext: function, onError?: undefined | function, onComplete?: undefined | function): IParallelStream<TOut[], TOut[]>
  • Parameters

    • onNext: function
        • (subResult: TOut[], taskIndex: number, valuesPerWorker: number): void
        • Parameters

          • subResult: TOut[]
          • taskIndex: number
          • valuesPerWorker: number

          Returns void

    • Optional onError: undefined | function
    • Optional onComplete: undefined | function

    Returns IParallelStream<TOut[], TOut[]>

then

  • then<TResult1, TResult2>(onfulfilled: function, onrejected: function): Promise<TResult2 | TResult1>
  • then<TResult>(onfulfilled: function, onrejected: function): Promise<TResult>
  • then<TResult>(onfulfilled: function): Promise<TResult>
  • then<TResult>(onfulfilled?: undefined | function, onrejected?: undefined | function): Promise<TResult>
  • then<TResult>(onfulfilled?: undefined | function, onrejected?: undefined | function): Promise<TResult>
  • Type parameters

    • TResult1

    • TResult2

    Parameters

    • onfulfilled: function
        • (value: TOut[]): TResult1 | PromiseLike<TResult1>
        • Parameters

          • value: TOut[]

          Returns TResult1 | PromiseLike<TResult1>

    • onrejected: function
        • (reason: any): TResult2 | PromiseLike<TResult2>
        • Parameters

          • reason: any

          Returns TResult2 | PromiseLike<TResult2>

    Returns Promise<TResult2 | TResult1>

  • Type parameters

    • TResult

    Parameters

    • onfulfilled: function
        • (value: TOut[]): TResult | PromiseLike<TResult>
        • Parameters

          • value: TOut[]

          Returns TResult | PromiseLike<TResult>

    • onrejected: function
        • (reason: any): TResult | PromiseLike<TResult>
        • Parameters

          • reason: any

          Returns TResult | PromiseLike<TResult>

    Returns Promise<TResult>

  • Type parameters

    • TResult

    Parameters

    • onfulfilled: function
        • (value: TOut[]): TResult | PromiseLike<TResult>
        • Parameters

          • value: TOut[]

          Returns TResult | PromiseLike<TResult>

    Returns Promise<TResult>

  • Type parameters

    • TResult

    Parameters

    • Optional onfulfilled: undefined | function
    • Optional onrejected: undefined | function

    Returns Promise<TResult>

  • Type parameters

    • TResult

    Parameters

    • Optional onfulfilled: undefined | function
    • Optional onrejected: undefined | function

    Returns Promise<TResult>

Generated using TypeDoc