|
@@ 410-417 (lines=8) @@
|
| 407 |
|
/** |
| 408 |
|
* {@inheritdoc} |
| 409 |
|
*/ |
| 410 |
|
public function subscribe(Mqtt\Subscription $subscription) : Promise\ExtendedPromiseInterface |
| 411 |
|
{ |
| 412 |
|
if (!$this->isConnected) { |
| 413 |
|
return new Promise\RejectedPromise(new Exceptions\LogicException('The client is not connected.')); |
| 414 |
|
} |
| 415 |
|
|
| 416 |
|
return $this->startFlow(new Mqtt\Flow\OutgoingSubscribeFlow([$subscription], $this->identifierGenerator)); |
| 417 |
|
} |
| 418 |
|
|
| 419 |
|
/** |
| 420 |
|
* {@inheritdoc} |
|
@@ 422-429 (lines=8) @@
|
| 419 |
|
/** |
| 420 |
|
* {@inheritdoc} |
| 421 |
|
*/ |
| 422 |
|
public function unsubscribe(Mqtt\Subscription $subscription) : Promise\ExtendedPromiseInterface |
| 423 |
|
{ |
| 424 |
|
if (!$this->isConnected) { |
| 425 |
|
return new Promise\RejectedPromise(new Exceptions\LogicException('The client is not connected.')); |
| 426 |
|
} |
| 427 |
|
|
| 428 |
|
return $this->startFlow(new Mqtt\Flow\OutgoingUnsubscribeFlow([$subscription], $this->identifierGenerator)); |
| 429 |
|
} |
| 430 |
|
|
| 431 |
|
/** |
| 432 |
|
* {@inheritdoc} |