Skip to content

handle exit single process in pool #30

@pilot114

Description

@pilot114
$manager = new \Ko\ProcessManager();
        for ($i = 0; $i < 10; $i++) {
            $manager->fork(function(\Ko\Process $p) use ($i) {
                echo 'Hello from ' . $p->getPid();
                sleep(1);
            })->onSuccess(function() {
                echo 'end';
            })->onError(function() {
                echo 'fail end';
            });
        }
$manager->wait();

OnSuccess / onError callbacks don't work if call wait() on process manager. If call wait () for each process handles call correct, but not parallel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions