1 | <?php |
||
18 | class QueueEventBus implements EventBusInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var EventQueueInterface |
||
22 | */ |
||
23 | private $queue; |
||
24 | |||
25 | /** |
||
26 | * @var EventBusInterface |
||
27 | */ |
||
28 | private $publisher_bus; |
||
29 | |||
30 | /** |
||
31 | * @param EventQueueInterface $queue |
||
32 | * @param EventBusInterface $publisher_bus |
||
33 | */ |
||
34 | public function __construct(EventQueueInterface $queue, EventBusInterface $publisher_bus) |
||
39 | |||
40 | /** |
||
41 | * Publishes the event $event to every EventListener that wants to. |
||
42 | * |
||
43 | * @param EventInterface $event |
||
44 | */ |
||
45 | public function publish(EventInterface $event) |
||
49 | |||
50 | /** |
||
51 | * @param AggregateEventsInterface $aggregator |
||
52 | */ |
||
53 | public function pullAndPublish(AggregateEventsInterface $aggregator) |
||
59 | |||
60 | /** |
||
61 | * Publishes the events from event queue to the publisher bus. |
||
62 | */ |
||
63 | public function publishFromQueue() |
||
75 | |||
76 | /** |
||
77 | * @return ListenerInterface[]|ListenerCollection |
||
78 | */ |
||
79 | public function getRegisteredEventListeners() |
||
83 | } |
||
84 |