MCPcopy
hub / github.com/redis/go-redis / performAsync

Function performAsync

main_test.go:248–264  ·  view source on GitHub ↗
(n int, cbs ...func(int))

Source from the content-addressed store, hash-verified

246}
247
248func performAsync(n int, cbs ...func(int)) *sync.WaitGroup {
249 var wg sync.WaitGroup
250 for _, cb := range cbs {
251 wg.Add(n)
252 // start from 1, so we can skip db 0 where such test is executed with
253 // select db command
254 for i := 1; i <= n; i++ {
255 go func(cb func(int), i int) {
256 defer GinkgoRecover()
257 defer wg.Done()
258
259 cb(i)
260 }(cb, i)
261 }
262 }
263 return &wg
264}
265
266func perform(n int, cbs ...func(int)) {
267 wg := performAsync(n, cbs...)

Callers 2

race_test.goFile · 0.85
performFunction · 0.85

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected