MCPcopy
hub / github.com/dropbox/godropbox / ExampleShardedClient

Function ExampleShardedClient

memcache/example_test.go:28–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26}
27
28func ExampleShardedClient() {
29 options := net2.ConnectionOptions{
30 MaxActiveConnections: 4,
31 }
32 manager := memcache.NewStaticShardManager(
33 []string{"localhost:11211", "localhost:11212"},
34 func(key string, numShard int) int {
35 return int(crc32.ChecksumIEEE([]byte(key))) % 2
36 },
37 options)
38
39 client := memcache.NewShardedClient(manager, memcache.NewRawBinaryClient)
40
41 clientExample(client)
42}
43
44func clientExample(client memcache.Client) {
45 version := func() {

Callers

nothing calls this directly

Calls 3

NewStaticShardManagerFunction · 0.92
NewShardedClientFunction · 0.92
clientExampleFunction · 0.85

Tested by

no test coverage detected