-
-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathRunner.php
More file actions
26 lines (20 loc) · 622 Bytes
/
Runner.php
File metadata and controls
26 lines (20 loc) · 622 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
namespace Runtime\React;
use Psr\Http\Server\RequestHandlerInterface;
use Symfony\Component\Runtime\RunnerInterface;
class Runner implements RunnerInterface
{
private RequestHandlerInterface $application;
private ServerFactory $serverFactory;
public function __construct(ServerFactory $serverFactory, RequestHandlerInterface $application)
{
$this->serverFactory = $serverFactory;
$this->application = $application;
}
public function run(): int
{
$loop = $this->serverFactory->createServer($this->application);
$loop->run();
return 0;
}
}