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