-
Notifications
You must be signed in to change notification settings - Fork 451
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
Fix ApnsPHP_Push to not send a pcnt_signal_dispatch if is not in serverMode #95
base: master
Are you sure you want to change the base?
Conversation
It makes sense, but can you explain what's the problem with |
For what I understand from the code the |
@jbaez ok, but can you explain your specific problem? What's your use case for which the dispatch is wrong. |
Yes, we have a script that uses |
@jbaez oh I guess that's because you are queuing the kill signal on purpose? Thus |
@lethalman the worker CLI script is running as a "daemon" doing a |
@jbaez if you get a SIGCHLD it's because the child has exited, and with Can you debug more the situation? I think |
@lethalman Well I debugged it, the problem was in the child job that involved sending APNS messages which uses this library, and |
@jbaez it's not a "fix", it's a fix for your program that you applied to this library. I'm sure existing applications are relying on apns triggering signals in the loop. I could accept a different patch: add an option to disable the dispatch. That is, by default it's on also for non-server mode, but the user can choose to disable it, though I don't see any reason for disabling it. |
@lethalman It is ok with me you don't want to accept the patch, but in my opinion there is no need to use |
@jbaez the reason for dispatching signals is that's a busy loop, and it would block signals if you don't dispatch them. It's quite natural for scripts, whether you are using the server class or your own customized server class. So the dispatch must be there in any normal case. Subclassing just to set a flag is inconvenient, I'd rather have an explicit |
@lethalman Ok then, I will add a commit to the pull request using the setter instead when I get some free time. |
If running standalone ApnsPHP_Push in a custom cli script that uses pcntl signals, sending APNS notifications will affect the proper function of it.