|
59 | 59 | use SwooleBundle\SwooleBundle\Server\Api\ApiServerClientFactory; |
60 | 60 | use SwooleBundle\SwooleBundle\Server\Api\ApiServerRequestHandler; |
61 | 61 | use SwooleBundle\SwooleBundle\Server\Api\WithApiServerConfiguration; |
| 62 | +use SwooleBundle\SwooleBundle\Server\ConcurrentTasks; |
62 | 63 | use SwooleBundle\SwooleBundle\Server\Config\Sockets; |
63 | 64 | use SwooleBundle\SwooleBundle\Server\Configurator\CallableChainConfiguratorFactory; |
64 | 65 | use SwooleBundle\SwooleBundle\Server\Configurator\WithHttpServerConfiguration; |
|
95 | 96 | use SwooleBundle\SwooleBundle\Server\Runtime\CallableBootManagerFactory; |
96 | 97 | use SwooleBundle\SwooleBundle\Server\Session\Storage; |
97 | 98 | use SwooleBundle\SwooleBundle\Server\Session\SwooleTableStorage; |
| 99 | +use SwooleBundle\SwooleBundle\Server\TaskHandler\ConcurrentTaskHandler; |
98 | 100 | use SwooleBundle\SwooleBundle\Server\TaskHandler\NoOpTaskFinishedHandler; |
99 | 101 | use SwooleBundle\SwooleBundle\Server\TaskHandler\NoOpTaskHandler; |
| 102 | +use SwooleBundle\SwooleBundle\Server\TaskHandler\SwooleTaskFinisher; |
100 | 103 | use SwooleBundle\SwooleBundle\Server\TaskHandler\TaskFinishedHandler; |
| 104 | +use SwooleBundle\SwooleBundle\Server\TaskHandler\TaskFinisher; |
101 | 105 | use SwooleBundle\SwooleBundle\Server\TaskHandler\TaskHandler; |
102 | 106 | use SwooleBundle\SwooleBundle\Server\WorkerHandler\WorkerErrorHandler; |
103 | 107 | use SwooleBundle\SwooleBundle\Server\WorkerHandler\WorkerExitHandler; |
|
483 | 487 | service(SystemSwooleFactory::class), |
484 | 488 | 'newInstance', |
485 | 489 | ]); |
| 490 | + |
| 491 | + $services->set(ConcurrentTasks\ConcurrentTasks::class) |
| 492 | + ->arg('$httpServer', service(HttpServer::class)); |
| 493 | + |
| 494 | + $services->set(TaskFinisher::class, SwooleTaskFinisher::class); |
| 495 | + |
| 496 | + $services->set(ConcurrentTaskHandler::class) |
| 497 | + ->decorate(TaskHandler::class) |
| 498 | + ->arg('$decorated', service(ConcurrentTaskHandler::class . '.inner')) |
| 499 | + ->arg('$taskFinisher', service(TaskFinisher::class)); |
486 | 500 | }; |
0 commit comments