| @@ 162-174 (lines=13) @@ | ||
| 159 | * |
|
| 160 | * @return PromiseAdapter |
|
| 161 | */ |
|
| 162 | public function publish($topicName, $arguments = null, $argumentsKw = null, $options = null) |
|
| 163 | { |
|
| 164 | $this->publications[$topicName] = static::createDeferredAdapter(); |
|
| 165 | $this->publishing[$topicName] = new PublishMessage( |
|
| 166 | count($this->publishing), |
|
| 167 | $options, |
|
| 168 | $topicName, |
|
| 169 | $arguments, |
|
| 170 | $argumentsKw |
|
| 171 | ); |
|
| 172 | ||
| 173 | return $this->publications[$topicName]->promise(); |
|
| 174 | } |
|
| 175 | ||
| 176 | /** |
|
| 177 | * Trigger a PUBLISHED message for given topic. |
|
| @@ 323-335 (lines=13) @@ | ||
| 320 | * |
|
| 321 | * @return PromiseAdapter |
|
| 322 | */ |
|
| 323 | public function call($procedureName, $arguments = null, $argumentsKw = null, $options = null) |
|
| 324 | { |
|
| 325 | $this->calls[$procedureName] = static::createDeferredAdapter(); |
|
| 326 | $this->calling[$procedureName] = new CallMessage( |
|
| 327 | count($this->calling), |
|
| 328 | $options, |
|
| 329 | $procedureName, |
|
| 330 | $arguments, |
|
| 331 | $argumentsKw |
|
| 332 | ); |
|
| 333 | ||
| 334 | return $this->calls[$procedureName]->promise(); |
|
| 335 | } |
|
| 336 | ||
| 337 | /** |
|
| 338 | * Process ResultMessage. |
|