MCPcopy Create free account
hub / github.com/sourcegraph/conc / WithFirstError

Method WithFirstError

pool/context_pool.go:64–68  ·  view source on GitHub ↗

WithFirstError configures the pool to only return the first error returned by a task. By default, Wait() will return a combined error. This is particularly useful for (*ContextPool).WithCancelOnError(), where all errors after the first are likely to be context.Canceled.

()

Source from the content-addressed store, hash-verified

62// This is particularly useful for (*ContextPool).WithCancelOnError(),
63// where all errors after the first are likely to be context.Canceled.
64func (p *ContextPool) WithFirstError() *ContextPool {
65 p.panicIfInitialized()
66 p.errorPool.WithFirstError()
67 return p
68}
69
70// WithCancelOnError configures the pool to cancel its context as soon as
71// any task returns an error or panics. By default, the pool's context is not

Callers

nothing calls this directly

Calls 1

panicIfInitializedMethod · 0.95

Tested by

no test coverage detected