Package hystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable. Based on the java project of the same name, by Netflix. https://github.com/Netflix/Hystrix Define your application logic which relies on external systems, passing your function to Go. When that system is healthy this will be the only thing which executes. If you want code to execute during a service outage, pass in a second function to Go. Ideally, the logic here will allow your application to gracefully handle external services being unavailable. This triggers when your code returns an error, or whenever it is unable to complete based on a variety of health checks https://github.com/Netflix/Hystrix/wiki/How-it-Works. Calling Go is like launching a goroutine, except you receive a channel of errors you can choose to monitor. Since calling a command and immediately waiting for it to finish is a common pattern, a synchronous API is available with the Do function which returns a single error. During application boot, you can call ConfigureCommand to tweak the settings for each command. You can also use Configure which accepts a map[string]CommandConfig. In your main.go, register the event stream HTTP handler on a port and launch it in a goroutine. Once you configure turbine for your Hystrix Dashboard https://github.com/Netflix/Hystrix/tree/master/hystrix-dashboard to start streaming events, your commands will automatically begin appearing.
Package hystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable. Based on the java project of the same name, by Netflix. https://github.com/Netflix/Hystrix Define your application logic which relies on external systems, passing your function to Go. When that system is healthy this will be the only thing which executes. If you want code to execute during a service outage, pass in a second function to Go. Ideally, the logic here will allow your application to gracefully handle external services being unavailable. This triggers when your code returns an error, or whenever it is unable to complete based on a variety of health checks https://github.com/Netflix/Hystrix/wiki/How-it-Works. Calling Go is like launching a goroutine, except you receive a channel of errors you can choose to monitor. Since calling a command and immediately waiting for it to finish is a common pattern, a synchronous API is available with the Do function which returns a single error. During application boot, you can call ConfigureCommand to tweak the settings for each command. You can also use Configure which accepts a map[string]CommandConfig. In your main.go, register the event stream HTTP handler on a port and launch it in a goroutine. Once you configure turbine for your Hystrix Dashboard https://github.com/Netflix/Hystrix/tree/master/hystrix-dashboard to start streaming events, your commands will automatically begin appearing.