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

[Feature Request] Process Timeout #4

Open
MCStreetguy opened this issue Nov 23, 2018 · 1 comment
Open

[Feature Request] Process Timeout #4

MCStreetguy opened this issue Nov 23, 2018 · 1 comment

Comments

@MCStreetguy
Copy link

I am currently using this cool library for a program of mine to execute shell commands in the background. But now I stumbled across a case where I miss a function.
A command that is executed hangs in case of an error instead of terminating itself. It would be very handy if you could also set a timeout for a command after which the process is automatically terminated if it is still running.

Do you think such a feature is realizable? And if not, can you think of a workaround to work around the problem?

Thank you in advance and best regards, Max.

@kamermans
Copy link
Owner

A timeout might be possible by using non-blocking streams and process termination: https://stackoverflow.com/questions/5309900/php-process-execution-timeout, but it probably wouldn't be very reliable since there are still places it could hang.

It's probably best to use an external utility like timeout: https://stackpointer.io/unix/unix-linux-run-command-with-timeout/500/

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

No branches or pull requests

2 participants