|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace MGDigital\BusQue; |
|
4
|
|
|
|
|
5
|
|
|
class Implementation |
|
6
|
|
|
{ |
|
7
|
|
|
|
|
8
|
|
|
private $queueNameResolver; |
|
9
|
|
|
private $commandSerializer; |
|
10
|
|
|
private $commandIdGenerator; |
|
11
|
|
|
private $queueAdapter; |
|
12
|
|
|
private $schedulerAdapter; |
|
13
|
|
|
private $clock; |
|
14
|
|
|
private $commandBusAdapter; |
|
15
|
|
|
private $errorHandler; |
|
16
|
|
|
|
|
17
|
|
|
public function __construct( |
|
18
|
|
|
QueueNameResolverInterface $queueNameResolver, |
|
19
|
|
|
CommandSerializerInterface $commandSerializer, |
|
20
|
|
|
CommandIdGeneratorInterface $commandIdGenerator, |
|
21
|
|
|
QueueAdapterInterface $queueAdapter, |
|
22
|
|
|
SchedulerAdapterInterface $schedulerAdapter, |
|
23
|
|
|
ClockInterface $clock, |
|
24
|
|
|
CommandBusAdapterInterface $commandBusAdapter, |
|
25
|
|
|
ErrorHandlerInterface $errorHandler |
|
26
|
|
|
) { |
|
27
|
|
|
$this->queueNameResolver = $queueNameResolver; |
|
28
|
|
|
$this->commandSerializer = $commandSerializer; |
|
29
|
|
|
$this->commandIdGenerator = $commandIdGenerator; |
|
30
|
|
|
$this->queueAdapter = $queueAdapter; |
|
31
|
|
|
$this->schedulerAdapter = $schedulerAdapter; |
|
32
|
|
|
$this->clock = $clock; |
|
33
|
|
|
$this->commandBusAdapter = $commandBusAdapter; |
|
34
|
|
|
$this->errorHandler = $errorHandler; |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
public function getQueueNameResolver(): QueueNameResolverInterface |
|
38
|
|
|
{ |
|
39
|
|
|
return $this->queueNameResolver; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public function getCommandSerializer(): CommandSerializerInterface |
|
43
|
|
|
{ |
|
44
|
|
|
return $this->commandSerializer; |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
public function getCommandIdGenerator(): CommandIdGeneratorInterface |
|
48
|
|
|
{ |
|
49
|
|
|
return $this->commandIdGenerator; |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
public function getQueueAdapter(): QueueAdapterInterface |
|
53
|
|
|
{ |
|
54
|
|
|
return $this->queueAdapter; |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
public function getSchedulerAdapter(): SchedulerAdapterInterface |
|
58
|
|
|
{ |
|
59
|
|
|
return $this->schedulerAdapter; |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
public function getClock(): ClockInterface |
|
63
|
|
|
{ |
|
64
|
|
|
return $this->clock; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
public function getCommandBusAdapter(): CommandBusAdapterInterface |
|
68
|
|
|
{ |
|
69
|
|
|
return $this->commandBusAdapter; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
public function getErrorHandler(): ErrorHandlerInterface |
|
73
|
|
|
{ |
|
74
|
|
|
return $this->errorHandler; |
|
75
|
|
|
} |
|
76
|
|
|
} |
|
77
|
|
|
|