Const
fallback to cache, if runner throw error, will try to return the latest cached value
the maximum number cache item (different parameters)
fallback to circuit
will directly raise error [[TemporaryUnAvailableError]] when some error happened before in duration
default is 10000 (10 seconds)
the timer & error cache size, default is 1024
recommend fallback policy
cache <- circuit <- retry <- runner
when error happened from runner
, retry
it firstly
if retry
finally failed, the circuit breaker
will open,
later requests in a duration will not be executed, and just throw the temp not available error
if the circuit
is open, cache
will catch the error, and try to get value from previous successful cache
if there is no successful cache before, throw the original error (maybe wrapper with [[TemporaryUnAvailableError]]) directly
fallback to retry
async function, return promise
the maximum number of times a runner should retry, default is 3
Optional
retryAfterMSecond: numberthe wait milliseconds before retry
fallback namespace