Options
All
  • Public
  • Public/Protected
  • All
Menu

Module timeout

Index

References

Functions Async

Functions Other

References

Renames and re-exports timeout

Async Functions

  • createTimeoutPromise<T>(executor: PromiseExecutor<T>, timeout?: number): Promise<T>
  • create a promise with timeout, if time is up but no result/error resolved by promise, will throw an error

    since

    5.14.0

    throws

    {TimeoutError}

    Type Parameters

    • T

    Parameters

    • executor: PromiseExecutor<T>

      the promise executor

    • timeout: number = ...

      the timeout in milliseconds, e.g. 10000 means 10 seconds, and default value is 60 seconds

    Returns Promise<T>

Other Functions

  • timeout<T>(executor: PromiseExecutor<T>, timeout?: number): Promise<T>
  • Type Parameters

    • T

    Parameters

    • executor: PromiseExecutor<T>
    • timeout: number = ...

    Returns Promise<T>