Avoid warning when catching signal with pcntl_signal() - #297
Conversation
|
Symfony's implementation is quite similar but more precise I think. See implementation at https://github.com/symfony/symfony/blob/27e1a893a090bf58bce774660f6cb5cbdfd4d287/src/Symfony/Component/Process/ProcessPipes.php#L359-L365 and usage at https://github.com/symfony/symfony/blob/27e1a893a090bf58bce774660f6cb5cbdfd4d287/src/Symfony/Component/Process/ProcessPipes.php#L235-L241 |
|
Great idea, but they use the prefix |
|
I'm curious about what low performance you're speaking. Symfony's code bypasses the error and check if it was a interrupted system call only if |
|
I was not saying my fix is more efficient than another. I just tried to avoid the |
|
no worries. Avoid the use of |
|
Fixes are available as @romainneutron advised. I saw a bug only after some commit sorry. |
|
Works like a charm. When does it get merged back? |
There was a problem hiding this comment.
Some tests would be much appreciated 👍
Also IIRC, the error messages take the user's LOCALE into account and might be translated to another language. If so, how should we match those?
|
@clue I've my locale set to french and the message is still in english. |
|
When is it planned to get merged? |
|
Why not merged yet? |
|
This is now a read-only repo made up of components loaded from composer. Merge requests need to made against the event-loop. In addition, I wouldn't want to include |
|
Right, supressing errors is bad for performance, especially inside the event-loop. I wouldn't put this into the core either. But there should be a way out for users. Maybe a special subclass or at least a hint in the docs. Regarding the check for the return-value: this should definitely be merged. If the stream_select-call fails, you should not rely on the references. |
|
Try use |
|
I am pretty sure this will slow down your app considerably. On Wed, Jun 10, 2015 at 7:51 AM, Kamil Harasimowicz <
|
|
Probably yes but in many cases it might not be as critical, and will work without problems. |
Creating a temporary error handler when selecting/accepting a stream to avoid warning messages, caused by catching a signal with function
pcntl_signal().See issue : #296