feat: FrankenPHP worker-mode compatibility for BackgroundProcess#39
Open
HecFranco wants to merge 1 commit into
Open
feat: FrankenPHP worker-mode compatibility for BackgroundProcess#39HecFranco wants to merge 1 commit into
HecFranco wants to merge 1 commit into
Conversation
Author
|
Hi maintainers, Thank you for maintaining this library and for keeping it available to the community over the years. This merge request adds FrankenPHP worker-mode compatibility ( I would appreciate your review and approval when you have a moment. Thank you again for your work and support. |
Implement ResetInterface, document safe DI usage, detect processes via /proc on Linux, and guard disabled shell_exec so long-lived workers do not leak request state.
HecFranco
force-pushed
the
feature/frankenphp-worker-compatibility
branch
from
July 18, 2026 08:55
ead9c00 to
b6be940
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes
cocur/background-processsafe to use under FrankenPHP worker mode (and other long-lived PHP runtimes) by ensuring request-scoped process state does not leak across requests.Changes
Symfony\Contracts\Service\ResetInterfaceandreset()to clear$command/$pidbetween requests when the instance is a shared serviceFactoryas a shared service and create a freshBackgroundProcessper operation/proc/<pid>on Linux soisRunning()works in minimal Docker/FrankenPHP images without apsbinaryRuntimeExceptionwhenshell_execis disabled>= 8.1, addsymfony/service-contracts, and modernize the test suite for PHPUnit 10/11Guidance for consumers
while ($process->isRunning()) { sleep(1); }inside an HTTP requestBackgroundProcess::createFromPID()laterdocs/FRANKENPHP.mdTest plan
docker run --rm -v "$PWD":/app -w /app php:8.3-cli ./vendor/bin/phpunit -c ./docs/FRANKENPHP.mdfor shared vs prototype service guidanceshell_execis enabled in target FrankenPHP images (or use Messenger / a queue instead)