1 | <?php |
||
17 | class Channel implements ChannelInterface |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * @var AMQPChannel |
||
22 | */ |
||
23 | protected $resource; |
||
24 | /** |
||
25 | * @var ConnectionInterface |
||
26 | */ |
||
27 | protected $connection; |
||
28 | /** |
||
29 | * @var Exchange |
||
30 | */ |
||
31 | protected $exchangePrototype; |
||
32 | /** |
||
33 | * @var Queue |
||
34 | */ |
||
35 | protected $queuePrototype; |
||
36 | |||
37 | /** |
||
38 | * Channel constructor. |
||
39 | * |
||
40 | * @param Exchange $exchangePrototype |
||
41 | * @param Queue $queuePrototype |
||
42 | */ |
||
43 | 13 | public function __construct(Exchange $exchangePrototype = null, Queue $queuePrototype = null) |
|
48 | |||
49 | /** |
||
50 | * @param Exchange $exchange |
||
51 | */ |
||
52 | 13 | public function registerExchange(Exchange $exchange) |
|
56 | |||
57 | /** |
||
58 | * @param Queue $queue |
||
59 | */ |
||
60 | 13 | public function registerQueue(Queue $queue) |
|
64 | |||
65 | /** |
||
66 | * @return AMQPChannel |
||
67 | */ |
||
68 | 8 | public function getResource() |
|
72 | |||
73 | /** |
||
74 | * @param AMQPChannel $resource |
||
75 | * @return $this |
||
76 | */ |
||
77 | 9 | public function setResource(AMQPChannel $resource) |
|
83 | |||
84 | /** |
||
85 | * Check the channel connection. |
||
86 | * |
||
87 | * @return bool Indicates whether the channel is connected. |
||
88 | */ |
||
89 | 1 | public function isConnected() |
|
93 | |||
94 | /** |
||
95 | * Return internal channel ID |
||
96 | * |
||
97 | * @return integer |
||
98 | */ |
||
99 | 1 | public function getChannelId() |
|
103 | |||
104 | /** |
||
105 | * Set the window size and the number of messages to prefetch from the broker. |
||
106 | * |
||
107 | * @param int $prefetchSize The window size, in octets, to prefetch. |
||
108 | * @param int $prefetchCount The number of messages to prefetch. |
||
109 | * @return $this |
||
110 | */ |
||
111 | 1 | public function setQos($prefetchSize, $prefetchCount) |
|
117 | |||
118 | /** |
||
119 | * Start a transaction. |
||
120 | * |
||
121 | * @return $this |
||
122 | */ |
||
123 | 1 | public function startTransaction() |
|
129 | |||
130 | /** |
||
131 | * Commit a pending transaction. |
||
132 | * |
||
133 | * @return $this |
||
134 | */ |
||
135 | 1 | public function commitTransaction() |
|
141 | |||
142 | /** |
||
143 | * Rollback a transaction. |
||
144 | * |
||
145 | * @return $this |
||
146 | */ |
||
147 | 1 | public function rollbackTransaction() |
|
153 | |||
154 | /** |
||
155 | * @param Connection $connection |
||
156 | * @return $this |
||
157 | */ |
||
158 | 2 | public function setConnection(Connection $connection) |
|
163 | |||
164 | /** |
||
165 | * Get the connection object in use |
||
166 | * |
||
167 | * @return Connection |
||
168 | */ |
||
169 | 2 | public function getConnection() |
|
173 | |||
174 | /** |
||
175 | * Redeliver unacknowledged messages. |
||
176 | * |
||
177 | * @param bool $requeue |
||
178 | * @return $this |
||
179 | */ |
||
180 | 2 | public function basicRecover($requeue = true) |
|
186 | |||
187 | /** |
||
188 | * Create a new queue |
||
189 | * |
||
190 | * @param Options\QueueOptions $options |
||
191 | * @return QueueInterface |
||
192 | */ |
||
193 | 1 | public function createQueue(Options\QueueOptions $options) |
|
202 | |||
203 | /** |
||
204 | * Create a new exchange |
||
205 | * |
||
206 | * @param Options\ExchangeOptions $options |
||
207 | * @return ExchangeInterface |
||
208 | */ |
||
209 | 1 | public function createExchange(Options\ExchangeOptions $options) |
|
218 | } |
||
219 |