@@ -123,7 +123,7 @@ public function getLocalChannels($appId): PromiseInterface
123
123
*/
124
124
public function getGlobalChannels ($ appId ): PromiseInterface
125
125
{
126
- return $ this ->getPublishClient () ->smembers (
126
+ return $ this ->publishClient ->smembers (
127
127
$ this ->getRedisKey ($ appId , null , ['channels ' ])
128
128
);
129
129
}
@@ -382,8 +382,7 @@ public function getChannelsMembersCount($appId, array $channelNames): PromiseInt
382
382
);
383
383
}
384
384
385
- return $ this ->publishClient
386
- ->exec ()
385
+ return $ this ->publishClient ->exec ()
387
386
->then (function ($ data ) use ($ channelNames ) {
388
387
return array_combine ($ channelNames , $ data );
389
388
});
@@ -553,11 +552,10 @@ public function decrementSubscriptionsCount($appId, string $channel = null, int
553
552
*/
554
553
public function addConnectionToSet (ConnectionInterface $ connection , $ moment = null )
555
554
{
556
- $ this ->getPublishClient ()
557
- ->zadd (
558
- $ this ->getRedisKey (null , null , ['sockets ' ]),
559
- Carbon::parse ($ moment )->format ('U ' ), "{$ connection ->app ->id }: {$ connection ->socketId }"
560
- );
555
+ $ this ->publishClient ->zadd (
556
+ $ this ->getRedisKey (null , null , ['sockets ' ]),
557
+ Carbon::parse ($ moment )->format ('U ' ), "{$ connection ->app ->id }: {$ connection ->socketId }"
558
+ );
561
559
}
562
560
563
561
/**
@@ -568,11 +566,10 @@ public function addConnectionToSet(ConnectionInterface $connection, $moment = nu
568
566
*/
569
567
public function removeConnectionFromSet (ConnectionInterface $ connection )
570
568
{
571
- $ this ->getPublishClient ()
572
- ->zrem (
573
- $ this ->getRedisKey (null , null , ['sockets ' ]),
574
- "{$ connection ->app ->id }: {$ connection ->socketId }"
575
- );
569
+ $ this ->publishClient ->zrem (
570
+ $ this ->getRedisKey (null , null , ['sockets ' ]),
571
+ "{$ connection ->app ->id }: {$ connection ->socketId }"
572
+ );
576
573
}
577
574
578
575
/**
@@ -585,14 +582,13 @@ public function removeConnectionFromSet(ConnectionInterface $connection)
585
582
*/
586
583
public function getConnectionsFromSet (int $ start = 0 , int $ stop = 0 )
587
584
{
588
- return $ this ->getPublishClient ()
589
- ->zrange (
590
- $ this ->getRedisKey (null , null , ['sockets ' ]),
591
- $ start , $ stop , 'withscores '
592
- )
593
- ->then (function ($ list ) {
594
- return Helpers::redisListToArray ($ list );
595
- });
585
+ return $ this ->publishClient ->zrange (
586
+ $ this ->getRedisKey (null , null , ['sockets ' ]),
587
+ $ start , $ stop , 'withscores '
588
+ )
589
+ ->then (function ($ list ) {
590
+ return Helpers::redisListToArray ($ list );
591
+ });
596
592
}
597
593
598
594
/**
@@ -604,7 +600,7 @@ public function getConnectionsFromSet(int $start = 0, int $stop = 0)
604
600
*/
605
601
public function addChannelToSet ($ appId , string $ channel )
606
602
{
607
- return $ this ->getPublishClient () ->sadd (
603
+ return $ this ->publishClient ->sadd (
608
604
$ this ->getRedisKey ($ appId , null , ['channels ' ]),
609
605
$ channel
610
606
);
@@ -619,7 +615,7 @@ public function addChannelToSet($appId, string $channel)
619
615
*/
620
616
public function removeChannelFromSet ($ appId , string $ channel )
621
617
{
622
- return $ this ->getPublishClient () ->srem (
618
+ return $ this ->publishClient ->srem (
623
619
$ this ->getRedisKey ($ appId , null , ['channels ' ]),
624
620
$ channel
625
621
);
0 commit comments