This repository was archived by the owner on Feb 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88use Psr \Container \ContainerInterface ;
99use Psr \Log \LoggerInterface ;
1010use React \EventLoop \Factory as EventLoopFactory ;
11+ use React \Promise \Promise ;
12+ use React \Promise \PromiseInterface ;
1113use React \Promise \Timer \TimeoutException ;
1214use ReactParallel \Factory ;
1315use ReactParallel \ObjectProxy \NonExistentInterface ;
@@ -130,7 +132,13 @@ public function metricsDestructionTesting(): void
130132 try {
131133 $ results = $ this ->await (
132134 // @phpstan-ignore-next-line
133- all ($ promises )->always (static function () use ($ limitedPool ): void {
135+ all ($ promises )->then (static function (array $ v ) use ($ factory ): PromiseInterface {
136+ return new Promise (static function (callable $ resolve ) use ($ v , $ factory ): void {
137+ $ factory ->loop ()->addTimer (3 , static function () use ($ resolve , $ v ): void {
138+ $ resolve ($ v );
139+ });
140+ });
141+ })->always (static function () use ($ limitedPool ): void {
134142 $ limitedPool ->close ();
135143 }),
136144 $ loop
You can’t perform that action at this time.
0 commit comments