diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-09-09 21:44:58 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-09-09 21:44:58 -0600 |
commit | b4f4fcd437c2f9816f9511217bde703679808679 (patch) | |
tree | 610a26ff132abd1451e6c5ce64ade84873d876ba /modules/caddyhttp/reverseproxy/hosts.go | |
parent | 50e62d06bcbc6b6486b382a22c633772443cfb6d (diff) |
Migrate some selection policy tests over to v2
Diffstat (limited to 'modules/caddyhttp/reverseproxy/hosts.go')
-rw-r--r-- | modules/caddyhttp/reverseproxy/hosts.go | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/modules/caddyhttp/reverseproxy/hosts.go b/modules/caddyhttp/reverseproxy/hosts.go index ad27625..1c0fae3 100644 --- a/modules/caddyhttp/reverseproxy/hosts.go +++ b/modules/caddyhttp/reverseproxy/hosts.go @@ -34,19 +34,21 @@ type Host interface { // Unhealthy returns true if the backend is unhealthy. Unhealthy() bool - // CountRequest counts the given number of requests - // as currently in process with the host. The count - // should not go below 0. + // CountRequest atomically counts the given number of + // requests as currently in process with the host. The + // count should not go below 0. CountRequest(int) error - // CountFail counts the given number of failures - // with the host. The count should not go below 0. + // CountFail atomically counts the given number of + // failures with the host. The count should not go + // below 0. CountFail(int) error - // SetHealthy marks the host as either healthy (true) - // or unhealthy (false). If the given status is the - // same, this should be a no-op. It returns true if - // the given status was different, false otherwise. + // SetHealthy atomically marks the host as either + // healthy (true) or unhealthy (false). If the given + // status is the same, this should be a no-op and + // return false. It returns true if the status was + // changed; i.e. if it is now different from before. SetHealthy(bool) (bool, error) } |