Created
October 23, 2021 18:45
-
-
Save oleh-zaporozhets/77f66055022a2c97fc222ce035ac00a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CircuitBreaker implements ICircuitBreaker { | |
| private readonly http: IHttp; | |
| private readonly timeout: number; | |
| private isOpen = false; | |
| private errorHandler: (error: any) => boolean; | |
| constructor(http: IHttp, options: ICircuitBreakerOptions) { | |
| this.http = http; | |
| this.timeout = options.timeout; | |
| this.errorHandler = options.errorHandler; | |
| } | |
| public getStatus() { | |
| return this.isOpen; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment