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.
()
| 62 | // This is particularly useful for (*ContextPool).WithCancelOnError(), |
| 63 | // where all errors after the first are likely to be context.Canceled. |
| 64 | func (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 |
nothing calls this directly
no test coverage detected