-
Notifications
You must be signed in to change notification settings - Fork 439
/
Copy pathPostSend.php
78 lines (61 loc) · 1.65 KB
/
PostSend.php
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
namespace Enqueue\Client;
use Interop\Queue\Destination;
use Interop\Queue\Message as TransportMessage;
final class PostSend
{
private $message;
private $producer;
private $driver;
private $transportDestination;
private $transportMessage;
public function __construct(
Message $message,
ProducerInterface $producer,
DriverInterface $driver,
Destination $transportDestination,
TransportMessage $transportMessage,
) {
$this->message = $message;
$this->producer = $producer;
$this->driver = $driver;
$this->transportDestination = $transportDestination;
$this->transportMessage = $transportMessage;
}
public function getMessage(): Message
{
return $this->message;
}
public function getProducer(): ProducerInterface
{
return $this->producer;
}
public function getDriver(): DriverInterface
{
return $this->driver;
}
public function getTransportDestination(): Destination
{
return $this->transportDestination;
}
public function getTransportMessage(): TransportMessage
{
return $this->transportMessage;
}
public function isEvent(): bool
{
return (bool) $this->message->getProperty(Config::TOPIC);
}
public function isCommand(): bool
{
return (bool) $this->message->getProperty(Config::COMMAND);
}
public function getCommand(): string
{
return $this->message->getProperty(Config::COMMAND);
}
public function getTopic(): string
{
return $this->message->getProperty(Config::TOPIC);
}
}