|
@@ 84-95 (lines=12) @@
|
| 81 |
|
* |
| 82 |
|
* @throws UnknownTopicException if the topic is unknown |
| 83 |
|
*/ |
| 84 |
|
public function completeSubscription($topicName, $requestId = 1, $subscriptionId = 1) |
| 85 |
|
{ |
| 86 |
|
if (!isset($this->subscriptions[$topicName])) { |
| 87 |
|
throw new UnknownTopicException($topicName); |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
/* @var $futureResult Deferred */ |
| 91 |
|
$futureResult = $this->subscriptions[$topicName]; |
| 92 |
|
$result = new SubscribedMessage($requestId, $subscriptionId); |
| 93 |
|
|
| 94 |
|
$futureResult->resolve($result); |
| 95 |
|
} |
| 96 |
|
|
| 97 |
|
public function hasSubscription($topicName) |
| 98 |
|
{ |
|
@@ 130-140 (lines=11) @@
|
| 127 |
|
* |
| 128 |
|
* @throws UnknownTopicException if the topic is unknown |
| 129 |
|
*/ |
| 130 |
|
public function confirmPublication($topicName, $requestId = 1, $publicationId = 1) |
| 131 |
|
{ |
| 132 |
|
if (!isset($this->publications[$topicName])) { |
| 133 |
|
throw new UnknownTopicException($topicName); |
| 134 |
|
} |
| 135 |
|
|
| 136 |
|
$futureResult = $this->publications[$topicName]; |
| 137 |
|
$result = new PublishedMessage($requestId, $publicationId); |
| 138 |
|
|
| 139 |
|
$futureResult->resolve($result); |
| 140 |
|
} |
| 141 |
|
|
| 142 |
|
public function failPublication($topicName, $error, $requestId = 1) |
| 143 |
|
{ |