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