1 | <?php |
||
14 | class Exchange implements ExchangeInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var Channel |
||
18 | */ |
||
19 | protected $channel; |
||
20 | /** |
||
21 | * @var Options\ExchangeOptions |
||
22 | */ |
||
23 | protected $options; |
||
24 | |||
25 | /** |
||
26 | * @return Options\ExchangeOptions |
||
27 | */ |
||
28 | 1 | public function getOptions() |
|
32 | |||
33 | /** |
||
34 | * @param Options\ExchangeOptions $exchangeOptions |
||
35 | * @return $this |
||
36 | */ |
||
37 | 15 | public function setOptions(Options\ExchangeOptions $exchangeOptions) |
|
42 | |||
43 | /** |
||
44 | * Declare a new exchange on the broker. |
||
45 | * |
||
46 | * @return $this |
||
47 | */ |
||
48 | 2 | public function declareExchange() |
|
63 | |||
64 | /** |
||
65 | * Delete the exchange from the broker. |
||
66 | * |
||
67 | * @param bool $ifUnused Optional if the exchange should not be |
||
68 | * deleted until no clients are connected to |
||
69 | * it. |
||
70 | * @param bool $noWait No wait for a reply |
||
71 | * |
||
72 | * @return $this |
||
73 | */ |
||
74 | 4 | public function delete($ifUnused = false, $noWait = false) |
|
80 | |||
81 | /** |
||
82 | * Bind to another exchange. |
||
83 | * |
||
84 | * Bind an exchange to another exchange using the specified routing key. |
||
85 | * |
||
86 | * @param string $exchangeName Name of the exchange to bind. |
||
87 | * @param string $routingKey The routing key to use for binding. |
||
88 | * @param bool $noWait No wait for a reply |
||
89 | * @param array $arguments Additional binding arguments. |
||
90 | * |
||
91 | * @return $this |
||
92 | */ |
||
93 | 2 | public function bind($exchangeName, $routingKey = null, $noWait = false, array $arguments = []) |
|
103 | |||
104 | /** |
||
105 | * Remove binding to another exchange. |
||
106 | * |
||
107 | * Remove a routing key binding on an another exchange from the given exchange. |
||
108 | * |
||
109 | * @param string $exchangeName Name of the exchange to bind. |
||
110 | * @param string $routingKey The routing key to use for binding. |
||
111 | * @param array $arguments Additional binding arguments. |
||
112 | * |
||
113 | * @return $this |
||
114 | */ |
||
115 | 2 | public function unbind($exchangeName, $routingKey = null, array $arguments = []) |
|
125 | |||
126 | /** |
||
127 | * Publish a message to an exchange. |
||
128 | * |
||
129 | * Publish a message to the exchange represented by the Exchange object. |
||
130 | * |
||
131 | * @param string $message The message to publish. |
||
132 | * @param string $routingKey The optional routing key to which to |
||
133 | * publish to. |
||
134 | * @param bool $mandatory Mandatory |
||
135 | * @param bool $immediate Immediate |
||
136 | * @param array $attributes One of content_type, content_encoding, |
||
137 | * message_id, user_id, app_id, delivery_mode, |
||
138 | * priority, timestamp, expiration, type |
||
139 | * or reply_to, headers. |
||
140 | * |
||
141 | * @return $this |
||
142 | */ |
||
143 | 4 | public function publish( |
|
167 | |||
168 | /** |
||
169 | * @param Channel $channel |
||
170 | * @return $this |
||
171 | */ |
||
172 | 16 | public function setChannel(Channel $channel) |
|
177 | |||
178 | /** |
||
179 | * Get the Channel object in use |
||
180 | * |
||
181 | * @return Channel |
||
182 | */ |
||
183 | 1 | public function getChannel() |
|
187 | |||
188 | /** |
||
189 | * Get the Connection object in use |
||
190 | * |
||
191 | * @return Connection |
||
192 | */ |
||
193 | 1 | public function getConnection() |
|
197 | } |
||
198 |