MCPcopy
hub / github.com/golang/groupcache / beChildForTestHTTPPool

Function beChildForTestHTTPPool

http_test.go:114–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112}
113
114func beChildForTestHTTPPool() {
115 addrs := strings.Split(*peerAddrs, ",")
116
117 p := NewHTTPPool("http://" + addrs[*peerIndex])
118 p.Set(addrToURL(addrs)...)
119
120 getter := GetterFunc(func(ctx context.Context, key string, dest Sink) error {
121 dest.SetString(strconv.Itoa(*peerIndex) + ":" + key)
122 return nil
123 })
124 NewGroup("httpPoolTest", 1<<20, getter)
125
126 log.Fatal(http.ListenAndServe(addrs[*peerIndex], p))
127}
128
129// This is racy. Another process could swoop in and steal the port between the
130// call to this function and the next listen call. Should be okay though.

Callers 1

TestHTTPPoolFunction · 0.85

Calls 6

SetMethod · 0.95
NewHTTPPoolFunction · 0.85
addrToURLFunction · 0.85
GetterFuncFuncType · 0.85
NewGroupFunction · 0.85
SetStringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…