Last active
March 15, 2018 07:23
-
-
Save rShetty/f269227df0288d3ddcdca75241b2d2ec to your computer and use it in GitHub Desktop.
Circuit breakers
This file contains 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
config := heimdall.HystrixCommandConfig{ | |
MaxConcurrentRequests: 100, | |
ErrorPercentThreshold: 25, | |
SleepWindow: 10, | |
RequestVolumeThreshold: 10, | |
} | |
hystrixConfig := heimdall.NewHystrixConfig(“MyCommand”, config) | |
timeout := 10 * time.Millisecond | |
httpClient := heimdall.NewHystrixHTTPClient(timeout, hystrixConfig) | |
_, err := httpClient.Get(“https://gojek.com/drivers”, http.Header{}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment