PHP Classes

File: tests/pid.php

Recommend this page to a friend!
  Classes of Wolfy-J   roadrunner   tests/pid.php   Download  
File: tests/pid.php
Role: Example script
Content type: text/plain
Description: Example script
Class: roadrunner
Run multiple tasks of PHP in parallel using Golang
Author: By
Last change:
Date: 6 years ago
Size: 288 bytes
 

Contents

Class file image Download
<?php
/**
 * @var Goridge\RelayInterface $relay
 */

use Spiral\Goridge;
use
Spiral\RoadRunner;

$rr = new RoadRunner\Worker($relay);

while (
$in = $rr->receive($ctx)) {
    try {
       
$rr->send((string)getmypid());
    } catch (\
Throwable $e) {
       
$rr->error((string)$e);
    }
}