go-hystrimp

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2015 License: Apache-2.0

README

HYSTRix IMProved

Hystrimp is a Go implementation of Hystrix, an innovative project from Netflix.

What Problem Does It Solve?

Hystrimp/Hystrix provide robustness and resilience in systems with external dependencies, particularly distributed systems (see this excellent introduction). Because the reality of distributed systems is complex, one should never interact with a remote API as if it were composed of local functions. Instead, one should consider important questions such as:

  • How long am I willing to wait for the remote system's response?
    • What should I do if I time out before receiving a response?
  • What do I do if the remote system responds with an error?
  • If a request times out or returns with an error, should I retry it?
    • How many times should I retry the request?
    • How long should I wait before retrying?
  • Should I bound the number of parallel requests I make?
  • If the remote system is overloaded with requests, is my system part of the problem?
    • How long should my system back off to allow the dependency to recover?

Hystrimp provides a Go implementation of these ideas:

Hystrix Flow

It improves upon hystrix-go (similar project) in the following ways:

  • Support for automatic retry of command with backoff upon remote errors or timeouts.
  • Remote commands are grouped into logical services
    • Support for concurrency limits on the service as a whole
    • Support for circuit breakers on a service as a whole
  • Better ergonomics/interface
  • Simpler implementation

Installing

  1. Install Go
  2. Install Godep (go get github.com/tools/godep)
  3. Run godep get github.com/Workiva/go-hystrimp/...

Updating

When new code is available on master, you can update with go get -u github.com/Workiva/go-hystrimp/...

Testing

To run unit tests, do

cd $GOPATH/src/github.com/Workiva/go-hystrimp
godep go test ./...

Running the Example

godep go build -o hystrimp-example -tags example ./example/main
./hystrimp-example

Contributing

To contribute, do the following:

  1. Create a feature branch from master
  2. Implement your contributions
  3. Ensure unit test coverage
  4. Ensure that you've complied with these guidelines
  5. gofmt your code
  6. Commit with good commit messages
  7. Create PR back to master

Reporting Bugs and Feature Requests

Bug reports and ideas for improvement are welcome! Please use GitHub's issue tracker.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/stretchr/objx
objx - Go package for dealing with maps, slices, JSON and other data.
objx - Go package for dealing with maps, slices, JSON and other data.
_workspace/src/github.com/stretchr/testify/assert
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
_workspace/src/github.com/stretchr/testify/mock
Provides a system by which it is possible to mock your objects and verify calls are happening as expected.
Provides a system by which it is possible to mock your objects and verify calls are happening as expected.
Package hystrimp contains a Go implementation of Netflix's Hystrix project.
Package hystrimp contains a Go implementation of Netflix's Hystrix project.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL