9951 explained code solutions for 126 technologies


php-swooleSet process name


$prc = new Swoole\Process(function($worker) {
  echo "Child PID " . $worker->pid . "\n";

  $worker->name('php_child');

  sleep(100);
}, FALSE, 1);

$prc->start();
usleep(100);
echo "\n";ctrl + c
$worker->pid

output child process PID

$worker->name

rename child process

->start()

start process (this will start child process in background)

usleep(100)

wait for some time to make sure child process have started