-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAsyncEventDispatcherBundle.php
More file actions
32 lines (25 loc) · 1.08 KB
/
AsyncEventDispatcherBundle.php
File metadata and controls
32 lines (25 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
namespace SkyDiablo\AsyncEventDispatcherBundle;
use SkyDiablo\AsyncEventDispatcherBundle\DependencyInjection\Compiler\EventSerializerCompiler;
use SkyDiablo\AsyncEventDispatcherBundle\DependencyInjection\Compiler\RegisterListenerCompiler;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class AsyncEventDispatcherBundle extends Bundle
{
const SERVICE_ASYNC_EVENT_DISPATCHER = 'async_event_dispatcher';
const TAG_LISTENER = 'kernel.event_listener.async';
const TAG_SUBSCRIBER = 'kernel.event_subscriber.async';
public function build(ContainerBuilder $container)
{
$container->addCompilerPass(new EventSerializerCompiler());
$container->addCompilerPass(
new RegisterListenerCompiler(
self::SERVICE_ASYNC_EVENT_DISPATCHER,
self::TAG_LISTENER,
self::TAG_SUBSCRIBER
),
PassConfig::TYPE_BEFORE_REMOVING
);
}
}