feat: unify php_server logic#2499
Conversation
09cd397 to
39db699
Compare
|
I changed the api again a bit, this feels like it makes the most sense (no idx passing required): server := frankenphp.NewServer(root, env, splitPath)
frankenphp.Init(frankenphp.WithServer(server))
server.ServeHTTP(request, responseWriter) |
|
Another subtlety I fixed: the "external workers" from |
henderkes
left a comment
There was a problem hiding this comment.
I think there's also a problem with DrainWorkers on main at the moment. Seems like it takes the same path with drainPHPThreads as Shutdown logic, but then never sets the state so the php threads could restart. Not directly related to this PR but probably better to fix it right here (or remove the function, it's marked experimental anyways).
|
|
|
+1 for removal because it currently hard-kills the current php runtime with no way to recover it, instead of letting threads perform a graceful reload. |
Currently the concept of a
php_serveronly exists on the caddy side and not the FrankenPHP side.Lately we have been moving more and more in a direction of scoping requests or workers to specific
php_serverblocks.This PR is an attempt at refactoring the current
php_serverlogic so it is properly mirrored on the FrankenPHP side without BC breaks for library users (and to prevent future bugs like mentioned in #2487)