|
@@ 397-404 (lines=8) @@
|
| 394 |
|
/** |
| 395 |
|
* {@inheritdoc} |
| 396 |
|
*/ |
| 397 |
|
public function subscribe(Mqtt\Subscription $subscription) : Promise\ExtendedPromiseInterface |
| 398 |
|
{ |
| 399 |
|
if (!$this->isConnected) { |
| 400 |
|
return new Promise\RejectedPromise(new Exceptions\LogicException('The client is not connected.')); |
| 401 |
|
} |
| 402 |
|
|
| 403 |
|
return $this->startFlow(new Mqtt\Flow\OutgoingSubscribeFlow([$subscription], $this->identifierGenerator)); |
| 404 |
|
} |
| 405 |
|
|
| 406 |
|
/** |
| 407 |
|
* {@inheritdoc} |
|
@@ 409-416 (lines=8) @@
|
| 406 |
|
/** |
| 407 |
|
* {@inheritdoc} |
| 408 |
|
*/ |
| 409 |
|
public function unsubscribe(Mqtt\Subscription $subscription) : Promise\ExtendedPromiseInterface |
| 410 |
|
{ |
| 411 |
|
if (!$this->isConnected) { |
| 412 |
|
return new Promise\RejectedPromise(new Exceptions\LogicException('The client is not connected.')); |
| 413 |
|
} |
| 414 |
|
|
| 415 |
|
return $this->startFlow(new Mqtt\Flow\OutgoingUnsubscribeFlow([$subscription], $this->identifierGenerator)); |
| 416 |
|
} |
| 417 |
|
|
| 418 |
|
/** |
| 419 |
|
* {@inheritdoc} |