@@ 188-199 (lines=12) @@ | ||
185 | * @param string $data |
|
186 | * @return void |
|
187 | */ |
|
188 | public function joinChannel($appId, string $channel, string $socketId, string $data) |
|
189 | { |
|
190 | $this->publishClient->__call('hset', ["{$appId}:{$channel}", $socketId, $data]); |
|
191 | ||
192 | DashboardLogger::log($appId, DashboardLogger::TYPE_REPLICATOR_JOINED_CHANNEL, [ |
|
193 | 'channel' => $channel, |
|
194 | 'serverId' => $this->getServerId(), |
|
195 | 'socketId' => $socketId, |
|
196 | 'data' => $data, |
|
197 | 'pubsub' => "{$appId}:{$channel}", |
|
198 | ]); |
|
199 | } |
|
200 | ||
201 | /** |
|
202 | * Remove a member from the channel. To be called when they have |
|
@@ 210-220 (lines=11) @@ | ||
207 | * @param string $socketId |
|
208 | * @return void |
|
209 | */ |
|
210 | public function leaveChannel($appId, string $channel, string $socketId) |
|
211 | { |
|
212 | $this->publishClient->__call('hdel', ["{$appId}:{$channel}", $socketId]); |
|
213 | ||
214 | DashboardLogger::log($appId, DashboardLogger::TYPE_REPLICATOR_LEFT_CHANNEL, [ |
|
215 | 'channel' => $channel, |
|
216 | 'serverId' => $this->getServerId(), |
|
217 | 'socketId' => $socketId, |
|
218 | 'pubsub' => "{$appId}:{$channel}", |
|
219 | ]); |
|
220 | } |
|
221 | ||
222 | /** |
|
223 | * Retrieve the full information about the members in a presence channel. |