|
@@ 227-238 (lines=12) @@
|
| 224 |
|
* @param string $data |
| 225 |
|
* @return void |
| 226 |
|
*/ |
| 227 |
|
public function joinChannel($appId, string $channel, string $socketId, string $data) |
| 228 |
|
{ |
| 229 |
|
$this->publishClient->__call('hset', [$this->getTopicName($appId, $channel), $socketId, $data]); |
| 230 |
|
|
| 231 |
|
DashboardLogger::log($appId, DashboardLogger::TYPE_REPLICATOR_JOINED_CHANNEL, [ |
| 232 |
|
'channel' => $channel, |
| 233 |
|
'serverId' => $this->getServerId(), |
| 234 |
|
'socketId' => $socketId, |
| 235 |
|
'data' => $data, |
| 236 |
|
'pubsub' => $this->getTopicName($appId, $channel), |
| 237 |
|
]); |
| 238 |
|
} |
| 239 |
|
|
| 240 |
|
/** |
| 241 |
|
* Remove a member from the channel. To be called when they have |
|
@@ 249-259 (lines=11) @@
|
| 246 |
|
* @param string $socketId |
| 247 |
|
* @return void |
| 248 |
|
*/ |
| 249 |
|
public function leaveChannel($appId, string $channel, string $socketId) |
| 250 |
|
{ |
| 251 |
|
$this->publishClient->__call('hdel', [$this->getTopicName($appId, $channel), $socketId]); |
| 252 |
|
|
| 253 |
|
DashboardLogger::log($appId, DashboardLogger::TYPE_REPLICATOR_LEFT_CHANNEL, [ |
| 254 |
|
'channel' => $channel, |
| 255 |
|
'serverId' => $this->getServerId(), |
| 256 |
|
'socketId' => $socketId, |
| 257 |
|
'pubsub' => $this->getTopicName($appId, $channel), |
| 258 |
|
]); |
| 259 |
|
} |
| 260 |
|
|
| 261 |
|
/** |
| 262 |
|
* Retrieve the full information about the members in a presence channel. |