diff --git a/README.md b/README.md index 2a8baa6..8d44876 100644 --- a/README.md +++ b/README.md @@ -90,10 +90,17 @@ import ( ) func ExampleUsage() { - // Keep track of peers in our cluster and add our instance to the pool `http://192.168.1.1:8080` + + // NOTE: It is important to pass the same peer `http://192.168.1.1:8080` to `NewHTTPPoolOpts` + // which is provided to `pool.Set()` so the pool can identify which of the peers is our instance. + // The pool will not operate correctly if it can't identify which peer is our instance. + + // Pool keeps track of peers in our cluster and identifies which peer owns a key. pool := groupcache.NewHTTPPoolOpts("http://192.168.1.1:8080", &groupcache.HTTPPoolOptions{}) - // Add more peers to the cluster (Ensure our instance is included) + // Add more peers to the cluster You MUST Ensure our instance is included in this list else + // determining who owns the key accross the cluster will not be consistent, and the pool won't + // be able to determine if our instance owns the key. pool.Set("http://192.168.1.1:8080", "http://192.168.1.2:8080", "http://192.168.1.3:8080") server := http.Server{