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

Use of the pnctl_signal function directly #4

Closed
marcioal1991 opened this issue May 27, 2024 · 0 comments
Closed

Use of the pnctl_signal function directly #4

marcioal1991 opened this issue May 27, 2024 · 0 comments

Comments

@marcioal1991
Copy link

Hello, leventcz! I'm reading the source code right now, and it's a great implementation! It will help us in various performance issues.

While I reading the code, I notice that you has used pnctl_signal directly in the TopCommand class, this isn't a problem in most laravel applications, but I thing it is better to use the trap() function provided but the Command class, specially for Laravel Octane purposes due to the nature of these types of applications. pnctl_signal doesn't accepts multiples handlers, so when you call the pnctl_signal function, it will replace the previous handler if it was registered, and lost the previous one. In Laravel Octane enviroment it may be dangerous in some scenarios.

Using the trap function (this function is provided by InteractsWithSignals trait, which supports "multiples handlers" for signals) will prevent this issue and allow the Laravel application to control this.

My suggest is as follows:
Screenshot from 2024-05-26 22-03-56

Best regards.

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

Successfully merging a pull request may close this issue.

2 participants