Updated TaskRunner and ListenerProvider so that they are lazyly created, preventing the Swoole server to be created more than once

This commit is contained in:
Alejandro Celaya 2019-08-08 14:08:39 +02:00
parent 38016b3ba3
commit 1349079f59

View File

@ -5,6 +5,7 @@ namespace Shlinkio\Shlink\EventDispatcher;
use Phly\EventDispatcher as Phly;
use Psr\EventDispatcher as Psr;
use Zend\ServiceManager\Proxy\LazyServiceFactory;
return [
@ -21,6 +22,16 @@ return [
'aliases' => [
Psr\EventDispatcherInterface::class => Phly\EventDispatcher::class,
],
'delegators' => [
Psr\ListenerProviderInterface::class => [
LazyServiceFactory::class,
],
],
'lazy_services' => [
'class_map' => [
Psr\ListenerProviderInterface::class => Psr\ListenerProviderInterface::class,
],
],
],
];