Skip to content

Commit caed515

Browse files
committedApr 19, 2013
docs and examples like a responsible author
1 parent 58b95b1 commit caed515

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed
 

‎README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
go-hostpool
22
===========
33

4-
Intelligently and flexibly pool among multiple hosts from your Go application.
4+
A Go package to intelligently and flexibly pool among multiple hosts from your Go application.
5+
Host selection can operate in round robin or epsilon greedy mode, and unresponsive hosts are
6+
avoided.
57
Usage example:
68

79
```go
@@ -12,4 +14,4 @@ err := _ // (make a request with hostname)
1214
hostResponse.Mark(err)
1315
```
1416

15-
View more detailed documentation on godoc.org
17+
View more detailed documentation on [godoc.org](http://godoc.org/github.com/bitly/go-hostpool)

‎example_test.go

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package hostpool_test
2+
3+
import (
4+
"github.com/bitly/go-hostpool"
5+
)
6+
7+
func Example_epsilon_greedy() {
8+
hp := hostpool.NewEpsilonGreedy([]string{"a", "b"}, 0, &hostpool.LinearEpsilonValueCalculator{})
9+
hostResponse := hp.Get()
10+
hostname := hostResponse.Host()
11+
err := _ // (make a request with hostname)
12+
hostResponse.Mark(err)
13+
}

‎hostpool.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// A Go package to intelligently and flexibly pool among multiple hosts from your Go application.
2+
// Host selection can operate in round robin or epsilon greedy mode, and unresponsive hosts are
3+
// avoided. A good overview of Epsilon Greedy is here http://stevehanov.ca/blog/index.php?id=132
14
package hostpool
25

36
import (

0 commit comments

Comments
 (0)