Options
All
  • Public
  • Public/Protected
  • All
Menu

Module fallback/circuit

Index

Classes

Functions Fallback

Fallback Functions

  • circuit<T>(runner: T, openDuration?: number, cacheSize?: number): T
  • fallback to circuit

    will directly raise error TemporaryUnAvailableError when some error happened before in duration

    Type parameters

    • T

    Parameters

    • runner: T
    • openDuration: number = ...

      default is 10000 (10 seconds)

    • cacheSize: number = 1024

      the timer & error cache size, default is 1024

    Returns T