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