MCPcopy Index your code
hub / github.com/php/frankenphp / WithWorkerMaxFailures

Function WithWorkerMaxFailures

options.go:216–225  ·  view source on GitHub ↗

WithWorkerMaxFailures sets the maximum number of consecutive failures before panicking

(maxFailures int)

Source from the content-addressed store, hash-verified

214
215// WithWorkerMaxFailures sets the maximum number of consecutive failures before panicking
216func 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
227func WithWorkerOnReady(f func(int)) WorkerOption {
228 return func(w *workerOpt) error {

Callers 5

TestFailingWorkerFunction · 0.92
ExampleServeHTTP_workersFunction · 0.92
StartMethod · 0.92

Calls

no outgoing calls

Tested by 4

TestFailingWorkerFunction · 0.74
ExampleServeHTTP_workersFunction · 0.74