@@ -59,7 +59,7 @@ public function enqueue(Closure $closure, array $args): void
59
59
// TODO enqueue args
60
60
}
61
61
62
- protected function _parallel (Closure $ closure , ...$ args )
62
+ protected function _parallel (Closure $ closure , string $ process_title = null , ...$ args )
63
63
{
64
64
self ::breakpoint ("started a parallel " );
65
65
self ::breakpoint ("parallel can be done: current childs: " .count ($ this ->childs )."/ " .$ this ->max_childs );
@@ -79,12 +79,15 @@ protected function _parallel(Closure $closure, ...$args)
79
79
if (!$ this ->kill_childs ) {
80
80
pcntl_signal (SIGINT , SIG_IGN );
81
81
}
82
+ if (isset ($ process_title )){
83
+ @cli_set_process_title ($ process_title );
84
+ }
82
85
$ closure ($ args );
83
86
exit ;
84
87
}
85
88
}
86
89
87
- public function parallel (Closure $ closure , ...$ args )
90
+ public function parallel (Closure $ closure , string $ process_title = null , ...$ args )
88
91
{
89
92
if (!empty ($ this ->queue )){
90
93
self ::breakpoint ("resolving queue before parallel() " );
@@ -103,7 +106,7 @@ public function parallel(Closure $closure, ...$args)
103
106
elseif (count ($ this ->childs ) > $ this ->max_childs /2 ){
104
107
$ this ->checkChilds ();
105
108
}
106
- return $ this ->_parallel ($ closure , ...$ args );
109
+ return $ this ->_parallel ($ closure , $ process_title , ...$ args );
107
110
}
108
111
109
112
public function resolveQueue ()
0 commit comments