1 | <?php |
||
19 | final class HttpServer |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $outputDirectory; |
||
25 | |||
26 | /** |
||
27 | * @var StreamSelectLoop |
||
28 | */ |
||
29 | private $streamSelectLoop; |
||
30 | |||
31 | /** |
||
32 | * @var ReactHttpServer |
||
33 | */ |
||
34 | private $reactHttpServer; |
||
35 | |||
36 | /** |
||
37 | * @var int |
||
38 | */ |
||
39 | private $port; |
||
40 | |||
41 | /** |
||
42 | * @var ReactSocketServer |
||
43 | */ |
||
44 | private $reactSocketServer; |
||
45 | |||
46 | /** |
||
47 | * @var OutputInterface |
||
48 | */ |
||
49 | private $output; |
||
50 | |||
51 | /** |
||
52 | * @var ResponseWriter |
||
53 | */ |
||
54 | private $responseWriter; |
||
55 | |||
56 | 2 | public function __construct(string $outputDirectory, OutputInterface $output, ResponseWriter $responseWriter) |
|
62 | |||
63 | 1 | public function init(int $port = 8000) |
|
84 | |||
85 | 1 | public function addPeriodicTimer(int $interval, callable $callback) |
|
89 | |||
90 | public function run() |
||
100 | |||
101 | 1 | private function setupDependencies() |
|
107 | } |
||
108 |