cockatiel
Version:
A resilience and transient-fault-handling library that allows developers to express policies such as Backoff, Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. Inspired by .NET Polly.
24 lines (23 loc) • 624 B
TypeScript
/**
* A generic type that returns backoff intervals.
*/
export interface IBackoffFactory<T> {
/**
* Returns the first backoff duration.
*/
next(context: T): IBackoff<T>;
}
/**
* A generic type that returns backoff intervals.
*/
export interface IBackoff<T> extends IBackoffFactory<T> {
/**
* Returns the number of milliseconds to wait for this backoff attempt.
*/
readonly duration: number;
}
export * from './ConstantBackoff';
export * from './DelegateBackoff';
export * from './ExponentialBackoff';
export * from './ExponentialBackoffGenerators';
export * from './IterableBackoff';