2
2
3
3
namespace Enqueue \AsyncEventDispatcher ;
4
4
5
+ use Enqueue \Client \CommandSubscriberInterface ;
5
6
use Enqueue \Consumption \Result ;
6
7
use Interop \Queue \PsrContext ;
7
8
use Interop \Queue \PsrMessage ;
8
9
use Interop \Queue \PsrProcessor ;
9
10
use Symfony \Component \EventDispatcher \EventDispatcherInterface ;
10
11
11
- class AsyncProcessor implements PsrProcessor
12
+ class AsyncProcessor implements PsrProcessor, CommandSubscriberInterface
12
13
{
13
14
/**
14
15
* @var Registry
@@ -20,10 +21,6 @@ class AsyncProcessor implements PsrProcessor
20
21
*/
21
22
private $ dispatcher ;
22
23
23
- /**
24
- * @param Registry $registry
25
- * @param EventDispatcherInterface $dispatcher
26
- */
27
24
public function __construct (Registry $ registry , EventDispatcherInterface $ dispatcher )
28
25
{
29
26
$ this ->registry = $ registry ;
@@ -39,9 +36,6 @@ public function __construct(Registry $registry, EventDispatcherInterface $dispat
39
36
$ this ->dispatcher = $ dispatcher ;
40
37
}
41
38
42
- /**
43
- * {@inheritdoc}
44
- */
45
39
public function process (PsrMessage $ message , PsrContext $ context )
46
40
{
47
41
if (false == $ eventName = $ message ->getProperty ('event_name ' )) {
@@ -57,4 +51,9 @@ public function process(PsrMessage $message, PsrContext $context)
57
51
58
52
return self ::ACK ;
59
53
}
54
+
55
+ public static function getSubscribedCommand ()
56
+ {
57
+ return Commands::DISPATCH_ASYNC_EVENTS ;
58
+ }
60
59
}
0 commit comments