| @@ 166-182 (lines=17) @@ | ||
| 163 | * |
|
| 164 | * @return PromiseAdapter |
|
| 165 | */ |
|
| 166 | public function publish($topicName, $arguments = null, $argumentsKw = null, $options = null) |
|
| 167 | { |
|
| 168 | $futureResult = new Deferred(); |
|
| 169 | ||
| 170 | $this->publications[$topicName] = $futureResult; |
|
| 171 | $this->publishing[$topicName] = new PublishMessage( |
|
| 172 | count($this->publishing), |
|
| 173 | $options, |
|
| 174 | $topicName, |
|
| 175 | $arguments, |
|
| 176 | $argumentsKw |
|
| 177 | ); |
|
| 178 | ||
| 179 | return $this->createPromiseAdapter( |
|
| 180 | $futureResult->promise() |
|
| 181 | ); |
|
| 182 | } |
|
| 183 | ||
| 184 | /** |
|
| 185 | * Trigger a PUBLISHED message for given topic. |
|
| @@ 339-355 (lines=17) @@ | ||
| 336 | * |
|
| 337 | * @return PromiseAdapter |
|
| 338 | */ |
|
| 339 | public function call($procedureName, $arguments = null, $argumentsKw = null, $options = null) |
|
| 340 | { |
|
| 341 | $futureResult = new Deferred(); |
|
| 342 | ||
| 343 | $this->calls[$procedureName] = $futureResult; |
|
| 344 | $this->calling[$procedureName] = new CallMessage( |
|
| 345 | count($this->calling), |
|
| 346 | $options, |
|
| 347 | $procedureName, |
|
| 348 | $arguments, |
|
| 349 | $argumentsKw |
|
| 350 | ); |
|
| 351 | ||
| 352 | return $this->createPromiseAdapter( |
|
| 353 | $futureResult->promise() |
|
| 354 | ); |
|
| 355 | } |
|
| 356 | ||
| 357 | /** |
|
| 358 | * Process ResultMessage. |
|