@@ 138-149 (lines=12) @@ | ||
135 | * |
|
136 | * @throws UnknownTopicException if the topic is unknown |
|
137 | */ |
|
138 | public function completeSubscription($topicName, $requestId = 1, $subscriptionId = 1) |
|
139 | { |
|
140 | if (!isset($this->subscriptions[$topicName])) { |
|
141 | throw new UnknownTopicException($topicName); |
|
142 | } |
|
143 | ||
144 | /* @var $futureResult Deferred */ |
|
145 | $futureResult = $this->subscriptions[$topicName]; |
|
146 | $result = new SubscribedMessage($requestId, $subscriptionId); |
|
147 | ||
148 | $futureResult->resolve($result); |
|
149 | } |
|
150 | ||
151 | public function hasSubscription($topicName) |
|
152 | { |
|
@@ 189-199 (lines=11) @@ | ||
186 | * |
|
187 | * @throws UnknownTopicException if the topic is unknown |
|
188 | */ |
|
189 | public function confirmPublication($topicName, $requestId = 1, $publicationId = 1) |
|
190 | { |
|
191 | if (!isset($this->publications[$topicName])) { |
|
192 | throw new UnknownTopicException($topicName); |
|
193 | } |
|
194 | ||
195 | $futureResult = $this->publications[$topicName]; |
|
196 | $result = new PublishedMessage($requestId, $publicationId); |
|
197 | ||
198 | $futureResult->resolve($result); |
|
199 | } |
|
200 | ||
201 | /** |
|
202 | * @param string $topicName |