MCPcopy Index your code
hub / github.com/sourcegraph/conc / Pool

Struct Pool

pool/pool.go:30–35  ·  view source on GitHub ↗

Pool is a pool of goroutines used to execute tasks concurrently. Tasks are submitted with Go(). Once all your tasks have been submitted, you must call Wait() to clean up any spawned goroutines and propagate any panics. Goroutines are started lazily, so creating a new pool is cheap. There will neve

Source from the content-addressed store, hash-verified

28// tasks. Startup and teardown come with an overhead of around 1µs, and each
29// task has an overhead of around 300ns.
30type Pool struct {
31 handle conc.WaitGroup
32 limiter limiter
33 tasks chan func()
34 initOnce sync.Once
35}
36
37// Go submits a task to be run in the pool. If all goroutines in the pool
38// are busy, a call to Go() will block until the task can be started.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected