This repository was archived by the owner on Jun 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +18
-42
lines changed Expand file tree Collapse file tree 3 files changed +18
-42
lines changed Original file line number Diff line number Diff line change 16
16
namespace Symfony \Component \HttpKernel ;
17
17
18
18
use React \Promise \PromiseInterface ;
19
+ use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
20
+ use Symfony \Component \DependencyInjection \ContainerBuilder ;
19
21
use Symfony \Component \HttpFoundation \Request ;
20
22
use Symfony \Component \HttpKernel \Exception \AsyncHttpKernelNeededException ;
21
23
22
24
/**
23
25
* Class AsyncKernel.
24
26
*/
25
- abstract class AsyncKernel extends Kernel
27
+ abstract class AsyncKernel extends Kernel implements CompilerPassInterface
26
28
{
27
29
/**
28
30
* Handles a Request to convert it to a Response.
@@ -57,4 +59,18 @@ public function handleAsync(
57
59
$ catch
58
60
);
59
61
}
62
+
63
+ /**
64
+ * You can modify the container here before it is dumped to PHP code.
65
+ */
66
+ public function process (ContainerBuilder $ container )
67
+ {
68
+ $ container
69
+ ->getDefinition ('event_dispatcher ' )
70
+ ->setClass (AsyncEventDispatcher::class);
71
+
72
+ $ container
73
+ ->getDefinition ('http_kernel ' )
74
+ ->setClass (AsyncHttpKernel::class);
75
+ }
60
76
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 12
12
"php" : " >=7.1" ,
13
13
14
14
"symfony/http-kernel" : " ^4.0" ,
15
+ "symfony/dependency-injection" : " ^4.0" ,
15
16
"react/promise" : " *"
16
17
},
17
18
"require-dev" : {
You can’t perform that action at this time.
0 commit comments