- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
Latest commit
26 lines (20 loc) · 503 Bytes
/
Copy pathexample.php
File metadata and controls
26 lines (20 loc) · 503 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
<?php
require_once(__DIR__ . "/Task.php");
require_once(__DIR__ . "/Cmd.php");
require_once(__DIR__ . "/TaskManager.php");
if (isset($argv[1])) {
echo$argv[1] . "\n";
usleep(100000);
exit();
}
$oTask = new \MultTask\TaskManager();
$oTask->setCheckTime(100000);
$oTask->setConcurrency(8);
$oTask->setRunLog(true);
$file = __DIR__ . '/example.php';
for ($i = 1; $i <= 1000; $i++) {
$sCmd = 'php ' . $file . '' . $i;
$oTask->addTask($sCmd);
}
$oTask->run();
echo"\nFinished\n";