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 11
11
*/
12
12
class Resque_Worker
13
13
{
14
+ /**
15
+ * @var string Prefix for the process name
16
+ */
17
+ private static $ processPrefix = 'resque ' ;
18
+
14
19
/**
15
20
* @var LoggerInterface Logging object that impliments the PSR-3 LoggerInterface
16
21
*/
@@ -81,6 +86,15 @@ public function __construct($queues)
81
86
$ this ->id = $ this ->hostname . ': ' .getmypid () . ': ' . implode (', ' , $ this ->queues );
82
87
}
83
88
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
+
84
98
/**
85
99
* Return all workers known to Resque as instantiated instances.
86
100
* @return array
@@ -376,7 +390,7 @@ private function startup()
376
390
*/
377
391
private function updateProcLine ($ status )
378
392
{
379
- $ processTitle = ' resque - ' . Resque::VERSION . ': ' . $ status ;
393
+ $ processTitle = static :: $ processPrefix . ' - ' . Resque::VERSION . ': ' . $ status ;
380
394
if (function_exists ('cli_set_process_title ' ) && PHP_OS !== 'Darwin ' ) {
381
395
cli_set_process_title ($ processTitle );
382
396
}
You can’t perform that action at this time.
0 commit comments