Created task running system based on event listener which are transparently cast into tasks

This commit is contained in:
Alejandro Celaya
2019-07-18 19:07:07 +02:00
parent 0dfadcbb4a
commit bccc177414
15 changed files with 238 additions and 127 deletions

View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink;
use Phly\EventDispatcher as Phly;
use Psr\EventDispatcher as Psr;
return [
'dependencies' => [
'factories' => [
Psr\ListenerProviderInterface::class => Common\EventDispatcher\ListenerProviderFactory::class,
],
'aliases' => [
Psr\EventDispatcherInterface::class => Phly\EventDispatcher::class,
],
],
];

View File

@@ -1,26 +0,0 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink;
use Phly\EventDispatcher as Phly;
use Psr\EventDispatcher as Psr;
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
return [
'dependencies' => [
'factories' => [
Common\EventDispatcher\SwooleEventDispatcher::class => ConfigAbstractFactory::class,
Psr\ListenerProviderInterface::class => Common\EventDispatcher\ListenerProviderFactory::class,
],
'aliases' => [
Psr\EventDispatcherInterface::class => Common\EventDispatcher\SwooleEventDispatcher::class,
],
],
ConfigAbstractFactory::class => [
Common\EventDispatcher\SwooleEventDispatcher::class => [Phly\EventDispatcher::class],
],
];

View File

@@ -5,10 +5,8 @@ namespace Shlinkio\Shlink;
use Acelaya\ExpressiveErrorHandler;
use Phly\EventDispatcher;
use Phly\Swoole\TaskWorker;
use Zend\ConfigAggregator;
use Zend\Expressive;
use function Shlinkio\Shlink\Common\env;
return (new ConfigAggregator\ConfigAggregator([
@@ -19,7 +17,6 @@ return (new ConfigAggregator\ConfigAggregator([
Expressive\Swoole\ConfigProvider::class,
ExpressiveErrorHandler\ConfigProvider::class,
EventDispatcher\ConfigProvider::class,
TaskWorker\ConfigProvider::class,
Common\ConfigProvider::class,
Core\ConfigProvider::class,
CLI\ConfigProvider::class,