|
@@ 193-200 (lines=8) @@
|
| 190 |
|
* @param mixed $appId |
| 191 |
|
* @return bool |
| 192 |
|
*/ |
| 193 |
|
public function subscribeToApp($appId): bool |
| 194 |
|
{ |
| 195 |
|
$this->subscribeClient->__call('subscribe', [$this->getTopicName($appId)]); |
| 196 |
|
|
| 197 |
|
$this->redis->hincrby($this->getTopicName($appId), 'connections', 1); |
| 198 |
|
|
| 199 |
|
return true; |
| 200 |
|
} |
| 201 |
|
|
| 202 |
|
/** |
| 203 |
|
* Unsubscribe from the app's pubsub keyspace. |
|
@@ 208-215 (lines=8) @@
|
| 205 |
|
* @param mixed $appId |
| 206 |
|
* @return bool |
| 207 |
|
*/ |
| 208 |
|
public function unsubscribeFromApp($appId): bool |
| 209 |
|
{ |
| 210 |
|
$this->subscribeClient->__call('unsubscribe', [$this->getTopicName($appId)]); |
| 211 |
|
|
| 212 |
|
$this->redis->hincrby($this->getTopicName($appId), 'connections', -1); |
| 213 |
|
|
| 214 |
|
return true; |
| 215 |
|
} |
| 216 |
|
|
| 217 |
|
/** |
| 218 |
|
* Add a member to a channel. To be called when they have |