File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1111 */
1212class Resque_Worker
1313{
14+ /**
15+ * @var string Prefix for the process name
16+ */
17+ private static $ processPrefix = 'resque ' ;
18+
1419 /**
1520 * @var LoggerInterface Logging object that impliments the PSR-3 LoggerInterface
1621 */
@@ -81,6 +86,15 @@ public function __construct($queues)
8186 $ this ->id = $ this ->hostname . ': ' .getmypid () . ': ' . implode (', ' , $ this ->queues );
8287 }
8388
89+ /**
90+ * Set the process prefix of the workers to the given prefix string.
91+ * @param string $prefix The new process prefix
92+ */
93+ public static function setProcessPrefix ($ prefix )
94+ {
95+ self ::$ processPrefix = $ prefix ;
96+ }
97+
8498 /**
8599 * Return all workers known to Resque as instantiated instances.
86100 * @return array
@@ -376,7 +390,7 @@ private function startup()
376390 */
377391 private function updateProcLine ($ status )
378392 {
379- $ processTitle = ' resque - ' . Resque::VERSION . ': ' . $ status ;
393+ $ processTitle = static :: $ processPrefix . ' - ' . Resque::VERSION . ': ' . $ status ;
380394 if (function_exists ('cli_set_process_title ' ) && PHP_OS !== 'Darwin ' ) {
381395 cli_set_process_title ($ processTitle );
382396 }
You can’t perform that action at this time.
0 commit comments