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)
| 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. |
| 123 | func 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. |
| 136 | func WithLogger(l *slog.Logger) Option { |