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

Function WithExtensionWorkers

options.go:123–133  ·  view source on GitHub ↗

EXPERIMENTAL: WithExtensionWorkers allow extensions to create workers. A worker script with the provided name, fileName and thread count will be registered, along with additional configuration through WorkerOptions. Workers are designed to run indefinitely and will be gracefully shut down when Fra

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

Source from the content-addressed store, hash-verified

121// cannot be allocated, then FrankenPHP will panic and provide this information to the user (who will need to allocate
122// more total threads). Don't be greedy.
123func WithExtensionWorkers(name, fileName string, numThreads int, options ...WorkerOption) (Workers, Option) {
124 w := &extensionWorkers{
125 name: name,
126 fileName: fileName,
127 num: numThreads,
128 }
129
130 w.options = append(options, withExtensionWorkers(w))
131
132 return w, WithWorkers(w.name, w.fileName, w.num, w.options...)
133}
134
135// WithLogger configures the global logger to use.
136func WithLogger(l *slog.Logger) Option {

Callers 4

RegisterWorkersFunction · 0.92
TestWorkersExtensionFunction · 0.85

Calls 2

withExtensionWorkersFunction · 0.85
WithWorkersFunction · 0.85

Tested by 3

TestWorkersExtensionFunction · 0.68