WithWorkerMaxFailures sets the maximum number of consecutive failures before panicking
(maxFailures int)
| 214 | |
| 215 | // WithWorkerMaxFailures sets the maximum number of consecutive failures before panicking |
| 216 | func WithWorkerMaxFailures(maxFailures int) WorkerOption { |
| 217 | return func(w *workerOpt) error { |
| 218 | if maxFailures < -1 { |
| 219 | return fmt.Errorf("max consecutive failures must be >= -1, got %d", maxFailures) |
| 220 | } |
| 221 | w.maxConsecutiveFailures = maxFailures |
| 222 | |
| 223 | return nil |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | func WithWorkerOnReady(f func(int)) WorkerOption { |
| 228 | return func(w *workerOpt) error { |
no outgoing calls