-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunner.php
More file actions
41 lines (31 loc) · 727 Bytes
/
Copy pathrunner.php
File metadata and controls
41 lines (31 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
include dirname(__DIR__) . '/src/autoload.php';
use phpth\process\supply\Runner;
class a
{
public static string $a = '';
public function test()
{
// pcntl_async_signals(true);
/* Options::registerSignal(SIGTERM, function (){
self::$a = 'TERMINAL';
echo 'TERMINAL', PHP_EOL;
});*/
sleep(20);
$a = range(0, 99);
sleep(3);
throw new Exception("sgcc");
}
}
$a = new a();
$r = [];
for($i=0;$i<=1;$i++){
$r[$i] = new Runner([$a, 'test'], [], 0, 'gsdfgg');
$r[$i]->run();
echo "main process id: ".getmypid().PHP_EOL;
}
while (true){
sleep(1);
}
//posix_kill($r->pid, SIGTERM);
//print_r($r->wait(true));