wip formatting
This commit is contained in:
parent
6755b42acf
commit
7a17d3529f
|
|
@ -123,7 +123,7 @@ class RedisChannelManager extends LocalChannelManager
|
||||||
*/
|
*/
|
||||||
public function getGlobalChannels($appId): PromiseInterface
|
public function getGlobalChannels($appId): PromiseInterface
|
||||||
{
|
{
|
||||||
return $this->getPublishClient()->smembers(
|
return $this->publishClient->smembers(
|
||||||
$this->getRedisKey($appId, null, ['channels'])
|
$this->getRedisKey($appId, null, ['channels'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -382,8 +382,7 @@ class RedisChannelManager extends LocalChannelManager
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->publishClient
|
return $this->publishClient->exec()
|
||||||
->exec()
|
|
||||||
->then(function ($data) use ($channelNames) {
|
->then(function ($data) use ($channelNames) {
|
||||||
return array_combine($channelNames, $data);
|
return array_combine($channelNames, $data);
|
||||||
});
|
});
|
||||||
|
|
@ -553,8 +552,7 @@ class RedisChannelManager extends LocalChannelManager
|
||||||
*/
|
*/
|
||||||
public function addConnectionToSet(ConnectionInterface $connection, $moment = null)
|
public function addConnectionToSet(ConnectionInterface $connection, $moment = null)
|
||||||
{
|
{
|
||||||
$this->getPublishClient()
|
$this->publishClient->zadd(
|
||||||
->zadd(
|
|
||||||
$this->getRedisKey(null, null, ['sockets']),
|
$this->getRedisKey(null, null, ['sockets']),
|
||||||
Carbon::parse($moment)->format('U'), "{$connection->app->id}:{$connection->socketId}"
|
Carbon::parse($moment)->format('U'), "{$connection->app->id}:{$connection->socketId}"
|
||||||
);
|
);
|
||||||
|
|
@ -568,8 +566,7 @@ class RedisChannelManager extends LocalChannelManager
|
||||||
*/
|
*/
|
||||||
public function removeConnectionFromSet(ConnectionInterface $connection)
|
public function removeConnectionFromSet(ConnectionInterface $connection)
|
||||||
{
|
{
|
||||||
$this->getPublishClient()
|
$this->publishClient->zrem(
|
||||||
->zrem(
|
|
||||||
$this->getRedisKey(null, null, ['sockets']),
|
$this->getRedisKey(null, null, ['sockets']),
|
||||||
"{$connection->app->id}:{$connection->socketId}"
|
"{$connection->app->id}:{$connection->socketId}"
|
||||||
);
|
);
|
||||||
|
|
@ -585,8 +582,7 @@ class RedisChannelManager extends LocalChannelManager
|
||||||
*/
|
*/
|
||||||
public function getConnectionsFromSet(int $start = 0, int $stop = 0)
|
public function getConnectionsFromSet(int $start = 0, int $stop = 0)
|
||||||
{
|
{
|
||||||
return $this->getPublishClient()
|
return $this->publishClient->zrange(
|
||||||
->zrange(
|
|
||||||
$this->getRedisKey(null, null, ['sockets']),
|
$this->getRedisKey(null, null, ['sockets']),
|
||||||
$start, $stop, 'withscores'
|
$start, $stop, 'withscores'
|
||||||
)
|
)
|
||||||
|
|
@ -604,7 +600,7 @@ class RedisChannelManager extends LocalChannelManager
|
||||||
*/
|
*/
|
||||||
public function addChannelToSet($appId, string $channel)
|
public function addChannelToSet($appId, string $channel)
|
||||||
{
|
{
|
||||||
return $this->getPublishClient()->sadd(
|
return $this->publishClient->sadd(
|
||||||
$this->getRedisKey($appId, null, ['channels']),
|
$this->getRedisKey($appId, null, ['channels']),
|
||||||
$channel
|
$channel
|
||||||
);
|
);
|
||||||
|
|
@ -619,7 +615,7 @@ class RedisChannelManager extends LocalChannelManager
|
||||||
*/
|
*/
|
||||||
public function removeChannelFromSet($appId, string $channel)
|
public function removeChannelFromSet($appId, string $channel)
|
||||||
{
|
{
|
||||||
return $this->getPublishClient()->srem(
|
return $this->publishClient->srem(
|
||||||
$this->getRedisKey($appId, null, ['channels']),
|
$this->getRedisKey($appId, null, ['channels']),
|
||||||
$channel
|
$channel
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue