MCPcopy Index your code
hub / github.com/panjf2000/ants / detach

Method detach

worker_stack.go:51–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49}
50
51func (ws *workerStack) detach() worker {
52 l := ws.len()
53 if l == 0 {
54 return nil
55 }
56
57 w := ws.items[l-1]
58 ws.items[l-1] = nil // avoid memory leaks
59 ws.items = ws.items[:l-1]
60
61 return w
62}
63
64func (ws *workerStack) refresh(duration time.Duration) []worker {
65 n := ws.len()

Callers

nothing calls this directly

Calls 1

lenMethod · 0.95

Tested by

no test coverage detected