Options
All
  • Public
  • Public/Protected
  • All
Menu

Module index

Index

Type aliases

Functions

Type aliases

BatchedFunction

BatchedFunction: (args: any[][]) => Promise<Promise<any>[]>

BatchedFunction models an async function that takes as argument an array of function arguments and resolves to an array of Promise

Type declaration

    • (args: any[][]): Promise<Promise<any>[]>
    • Parameters

      • args: any[][]

      Returns Promise<Promise<any>[]>

SingularFunction

SingularFunction: (...args: any[]) => Promise<any>

SingularFunction models any async function

Type declaration

    • (...args: any[]): Promise<any>
    • Parameters

      • Rest ...args: any[]

      Returns Promise<any>

Functions

singular

  • singular(batched: BatchedFunction, __namedParameters?: { maxBatchSize?: undefined | number; maxConcurrent?: undefined | number; minConcurrent?: undefined | number }): SingularFunction
  • Converts a batched functions to a singular one. Al least minConcurrent calls and at most maxConcurrent are done at a time, at most maxBatchSize is allocated to each call. When maxBatchSize is reached, more concurrent calls are made, until maxConcurrent is reached, if specified. Each call takes a part of the remaining queue

    Parameters

    • batched: BatchedFunction

      the batched function

    • __namedParameters: { maxBatchSize?: undefined | number; maxConcurrent?: undefined | number; minConcurrent?: undefined | number } = ...
      • Optional maxBatchSize?: undefined | number

        the maximum batch size allocated to a call

      • Optional maxConcurrent?: undefined | number

        the maximum number of concurrent calls

      • Optional minConcurrent?: undefined | number

        the minimum number of concurrent calls

    Returns SingularFunction

    the singular function

Generated using TypeDoc