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

Function WithWorkers

options.go:90–111  ·  view source on GitHub ↗

WithWorkers configures the PHP workers to start

(name, fileName string, num int, options ...WorkerOption)

Source from the content-addressed store, hash-verified

88
89// WithWorkers configures the PHP workers to start
90func WithWorkers(name, fileName string, num int, options ...WorkerOption) Option {
91 return func(o *opt) error {
92 worker := workerOpt{
93 name: name,
94 fileName: fileName,
95 num: num,
96 env: PrepareEnv(nil),
97 watch: []string{},
98 maxConsecutiveFailures: defaultMaxConsecutiveFailures,
99 }
100
101 for _, option := range options {
102 if err := option(&worker); err != nil {
103 return err
104 }
105 }
106
107 o.workers = append(o.workers, worker)
108
109 return nil
110 }
111}
112
113// EXPERIMENTAL: WithExtensionWorkers allow extensions to create workers.
114//

Callers 8

runTestFunction · 0.92
TestFailingWorkerFunction · 0.92
ExampleServeHTTP_workersFunction · 0.92
StartMethod · 0.92
WithExtensionWorkersFunction · 0.85

Calls 1

PrepareEnvFunction · 0.85

Tested by 6

runTestFunction · 0.74
TestFailingWorkerFunction · 0.74
ExampleServeHTTP_workersFunction · 0.74