Skip to content

Instantly share code, notes, and snippets.

@rShetty
Last active March 15, 2018 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rShetty/f269227df0288d3ddcdca75241b2d2ec to your computer and use it in GitHub Desktop.
Save rShetty/f269227df0288d3ddcdca75241b2d2ec to your computer and use it in GitHub Desktop.
Circuit breakers
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