Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listen on a TCP/UDP port for restart commands #59

Open
brianlmoon opened this issue Jun 7, 2013 · 2 comments
Open

Listen on a TCP/UDP port for restart commands #59

brianlmoon opened this issue Jun 7, 2013 · 2 comments
Assignees

Comments

@brianlmoon
Copy link
Owner

On a large architecture, you may want to have your workers restart when new code is deployed. Currently GM only restarts when workers change. If non-worker code that is already loaded in GM changes, it is not able to detect that.

The GM helper process could listen on TCP or UDP and take requests. The least of which is a reload command.

@ghost ghost assigned brianlmoon Jun 7, 2013
@conradjones
Copy link

Yes this would be helpful Brian. we have quite a few libraries that forces us to restart the service if they change.

@ReduktorSpalin
Copy link
Contributor

It might be a future plan and quite risky (cause it affects whole architecture), but did you think about using ReactPHP or whole PHP Process Manager (php-pm)?

https://github.com/php-pm/php-pm
https://reactphp.org/

It even might be out of this issue's scope and require external dependency or porting that logic into this project.

I think this project is awesome when it comes to dependencies (right now they are just core php extensions). I might argue about stuff like logging, PSR compliance or @-suppresors, but being lightweight and dependency-less makes it quite stable, extensible and easier to maintain compared to feature-full projects.

Yet listening to socket and usleep in my opinion might be two contradicting solutions. I know well, that process that does not sleep occupies CPU time, but I wonder if there is a better technique to handle such long-running processes. Maybe something derived from SystemD or SysV world?

Like Circuit Breaker implementation (it should be tested) - inverting conditions. But cirtcuit breaker mostly requires stable state-handling (https://martinfowler.com/bliki/CircuitBreaker.html).

That's just a thought of multitasking issue, that I think this feature would require to be done and tested earlier.

Do you agree? How does it sound?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants