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

Process cleanup handler #2

Open
gregsuper opened this issue Dec 28, 2023 · 1 comment
Open

Process cleanup handler #2

gregsuper opened this issue Dec 28, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@gregsuper
Copy link

I would like to thank you for the package provided as an alternative to workers, which allows, in my development concept, to instantly run the required code asynchronously.

I have an idea for improving the package - it would be nice to have a handler for cleaning up all running processes by the package.
This way we can clean up all running processes without waiting for their timeout when necessary.
For example, like: php artisan queue:clear

Sample code I'm currently using to clean up all processes on linux:
Process::quietly()->run('for pid in $(pgrep -f laravel-async); do kill $pid; done');

What do you think about this idea or are there certain conditions and limitations where integrating cleanup without waiting for a timeout seems like a bad idea?

@saeedvaziry
Copy link
Owner

Hey @greglaych,
Sounds like a good idea to me. an addition to that would be a command to get the list of the currently running processes with their process ID.
Feel free to open a PR 💪

@saeedvaziry saeedvaziry added the enhancement New feature or request label Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants