|
@@ 184-191 (lines=8) @@
|
| 181 |
|
* @param mixed $appId |
| 182 |
|
* @return bool |
| 183 |
|
*/ |
| 184 |
|
public function subscribeToApp($appId): bool |
| 185 |
|
{ |
| 186 |
|
$this->subscribeClient->subscribe($this->getTopicName($appId)); |
| 187 |
|
|
| 188 |
|
$this->publishClient->hincrby($this->getTopicName($appId), 'connections', 1); |
| 189 |
|
|
| 190 |
|
return true; |
| 191 |
|
} |
| 192 |
|
|
| 193 |
|
/** |
| 194 |
|
* Unsubscribe from the app's pubsub keyspace. |
|
@@ 199-206 (lines=8) @@
|
| 196 |
|
* @param mixed $appId |
| 197 |
|
* @return bool |
| 198 |
|
*/ |
| 199 |
|
public function unsubscribeFromApp($appId): bool |
| 200 |
|
{ |
| 201 |
|
$this->subscribeClient->unsubscribe($this->getTopicName($appId)); |
| 202 |
|
|
| 203 |
|
$this->publishClient->hincrby($this->getTopicName($appId), 'connections', -1); |
| 204 |
|
|
| 205 |
|
return true; |
| 206 |
|
} |
| 207 |
|
|
| 208 |
|
/** |
| 209 |
|
* Add a member to a channel. To be called when they have |