-
Notifications
You must be signed in to change notification settings - Fork 762
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
Let Resque_Worker::updateProcLine() use PHP 5.5's cli_set_process_title() if available #131
Let Resque_Worker::updateProcLine() use PHP 5.5's cli_set_process_title() if available #131
Conversation
…is preferred over the PECL function setproctitle().
Seems sound. |
On checking the code, it looks good as well, though I have a couple of comments which don't impact functionality. Would it make sense to construct the title into a temporary variable prior to checking for either function, so we aren't duplicating code (and thereby forcing ourselves to maintain two separate lines of code identically if the title format ever changes for any reason)? Is this a valid application of DRY principles, or simply a tad overboard? Why on earth is the |
Looks great, but I would like to see the title built once and passed in as a variable like @danhunsaker was saying above. |
@danhunsaker @Rockstar04 I asked myself the same two questions when I wrote this code:
|
Picking nits, but now the indentation isn't consistent. >_> I blame selection of spaces over tabs. Stupid maximum-fixed-width code lines. |
Ooops, my fault. Editor in the wrong mode. |
TIL Thanks :) |
Let Resque_Worker::updateProcLine() use PHP 5.5's cli_set_process_title() if available
Let Resque_Worker::updateProcLine() use PHP 5.5's cli_set_process_title() if available chrisboulton/php-resque#131
updateProcLine() uses the PECL function setproctitle() if available. It should also try to use cli_set_process_title(), available in PHP 5.5.
cli_set_process_title() is preferred because setproctitle() is "incomplete and might lead to memory corruption on Linux". (See https://wiki.php.net/rfc/cli_process_title )