Total Complexity | 2 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
21 | class Server |
||
22 | { |
||
23 | use Chains, Events, Boots, Wants, Plugins; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $name = null; |
||
29 | |||
30 | /** |
||
31 | * @var Address |
||
32 | */ |
||
33 | private $listen = null; |
||
34 | |||
35 | /** |
||
36 | * HTTP constructor. |
||
37 | * @param string $name |
||
38 | * @param Address $listen |
||
39 | */ |
||
40 | public function __construct(string $name, Address $listen) |
||
41 | { |
||
42 | $this->name = $name; |
||
43 | $this->listen = $listen; |
||
44 | |||
45 | $this->events()->attach(NETEvs\Worker::STARTED, function (Conn $ctx) { |
||
46 | $ctx->events()->attach(NETEvs\HTTP::REQUESTING, self::layers()->handler()); |
||
47 | }); |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @param int $workers |
||
52 | */ |
||
53 | public function run(int $workers) : void |
||
56 | } |
||
57 | } |
||
58 |