1 | <?php |
||
15 | class Exchange implements ExchangeInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var Channel |
||
19 | */ |
||
20 | protected $channel; |
||
21 | /** |
||
22 | * @var Options\ExchangeOptions |
||
23 | */ |
||
24 | protected $options; |
||
25 | |||
26 | /** |
||
27 | * @return Options\ExchangeOptions |
||
28 | */ |
||
29 | 2 | public function getOptions() |
|
33 | |||
34 | /** |
||
35 | * @param Options\ExchangeOptions|\Traversable|array $exchangeOptions |
||
36 | * @return $this |
||
37 | * @throws BaseException\BadMethodCallException |
||
38 | * @throws BaseException\InvalidArgumentException |
||
39 | */ |
||
40 | 22 | public function setOptions($exchangeOptions) |
|
48 | |||
49 | /** |
||
50 | * Declare a new exchange on the broker. |
||
51 | * |
||
52 | * @return $this |
||
53 | */ |
||
54 | 8 | public function declareExchange() |
|
69 | |||
70 | /** |
||
71 | * Delete the exchange from the broker. |
||
72 | * |
||
73 | * @param bool $ifUnused Optional if the exchange should not be |
||
74 | * deleted until no clients are connected to |
||
75 | * it. |
||
76 | * @param bool $noWait No wait for a reply |
||
77 | * |
||
78 | * @return $this |
||
79 | */ |
||
80 | 4 | public function delete($ifUnused = false, $noWait = false) |
|
86 | |||
87 | /** |
||
88 | * Bind to another exchange. |
||
89 | * |
||
90 | * Bind an exchange to another exchange using the specified routing key. |
||
91 | * |
||
92 | * @param string $exchangeName Name of the exchange to bind. |
||
93 | * @param string $routingKey The routing key to use for binding. |
||
94 | * @param bool $noWait No wait for a reply |
||
95 | * @param array $arguments Additional binding arguments. |
||
96 | * |
||
97 | * @return $this |
||
98 | */ |
||
99 | 2 | public function bind($exchangeName, $routingKey = null, $noWait = false, array $arguments = []) |
|
109 | |||
110 | /** |
||
111 | * Remove binding to another exchange. |
||
112 | * |
||
113 | * Remove a routing key binding on an another exchange from the given exchange. |
||
114 | * |
||
115 | * @param string $exchangeName Name of the exchange to bind. |
||
116 | * @param string $routingKey The routing key to use for binding. |
||
117 | * @param array $arguments Additional binding arguments. |
||
118 | * |
||
119 | * @return $this |
||
120 | */ |
||
121 | 2 | public function unbind($exchangeName, $routingKey = null, array $arguments = []) |
|
131 | |||
132 | /** |
||
133 | * Publish a message to an exchange. |
||
134 | * |
||
135 | * Publish a message to the exchange represented by the Exchange object. |
||
136 | * |
||
137 | * @param string $message The message to publish. |
||
138 | * @param string $routingKey The optional routing key to which to |
||
139 | * publish to. |
||
140 | * @param bool $mandatory Mandatory |
||
141 | * @param bool $immediate Immediate |
||
142 | * @param array $attributes One of content_type, content_encoding, |
||
143 | * message_id, user_id, app_id, delivery_mode, |
||
144 | * priority, timestamp, expiration, type |
||
145 | * or reply_to, headers. |
||
146 | * |
||
147 | * @return $this |
||
148 | */ |
||
149 | 9 | public function publish( |
|
173 | |||
174 | /** |
||
175 | * @param Channel $channel |
||
176 | * @return $this |
||
177 | */ |
||
178 | 22 | public function setChannel(Channel $channel) |
|
183 | |||
184 | /** |
||
185 | * Get the Channel object in use |
||
186 | * |
||
187 | * @return Channel |
||
188 | */ |
||
189 | 1 | public function getChannel() |
|
193 | |||
194 | /** |
||
195 | * Get the Connection object in use |
||
196 | * |
||
197 | * @return Connection |
||
198 | */ |
||
199 | 1 | public function getConnection() |
|
203 | } |
||
204 |