Passed
Push — master ( 2f5dcf...04013c )
by Wim
06:39
created

Tracker::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 6
nc 2
nop 0
dl 0
loc 12
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Thunderbug\Tracker;
4
5
use Spatie\Async\Pool;
6
use Thunderbug\Tracker\Tasks\GameserverTasks;
7
8
class Tracker
9
{
10
    /**
11
     * Run tracker CLI
12
     */
13
    public static function run()
14
    {
15
        $pool = Pool::create();
16
        $pool->concurrency(200);
17
18
        $servers = Master::getServers("cod4master.activision.com", 20810);
19
        foreach ($servers as $server)
20
        {
21
            $pool->add(new GameserverTasks($server))->catch(function() {});
22
        }
23
24
        $pool->wait();
25
    }
26
}