Swoole\Process\ProcessManager->start

Declaration

<?php
Swoole\Process\ProcessManager->start()

Parameters

Return

Description

Start the process manager.

Example

<?php
$pm = new Swoole\Process\ProcessManager();
$atomic = new Atomic(0);
$pm->add(function (Pool $pool, int $workerId) use ($atomic) {
    usleep(100000);
    $atomic->wakeup();
});
$pm->add(function (Pool $pool, int $workerId) use ($atomic) {
    $atomic->wait(1.5);
    $pool->shutdown();
});
$pm->start();