fitstar/falcore — pull request #36 by dgrijalva (2014-06-16 01:44:39+00:00)
Title: Refactor UpstreamPool

**This change is not backwards compatible**

I refactored the upstream pool to gain several functional improvements:
* The pool entries can now be modified while the server is running
* Weight values are actually observed. 0 still means off.
* Down status is a separate flag from weight
* `UpstreamEntry` has been privatized
* New methods adding for adding, removing, up/downing, and re-weighting upstreams

Motivations:
* having `UpstreamEntry` exposed was fairly dangerous as a developer could modify its properties without holding the mutex
* support for real weighting has been missing for a long time
* separating weight from down status makes both values more useful
* allowing runtime pool changes allows for graceful integration with service discovery tools such as [etcd](https://github.com/coreos/etcd)

Breaking changes:
* the `UpstreamEntry` type is now private
* all methods are now on `*UpstreamPool` instead of `UpstreamPool`
* `NewUpstreamPool` now takes only 1 argument. Use the `AddUpstream` method after creating the pool.
* the `Next` method has been removed. this has been internalized (anyone object to this?)