summaryrefslogtreecommitdiff
path: root/tests/slow-pid.php
blob: 8278561032544fc3d39f77fdcae52ed50292ae86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
 /**
  * @var Goridge\RelayInterface $relay
  */

 use Spiral\Goridge;
 use Spiral\RoadRunner;

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

 while ($in = $rr->waitPayload()) {
     try {
         sleep(1);
         $rr->respond(new RoadRunner\Payload((string)getmypid()));
     } catch (\Throwable $e) {
         $rr->error((string)$e);
     }
 }