Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit d6b6135

Browse files
committed
Removed $this->connection from RedisPusherBroadcaster
1 parent e67fe38 commit d6b6135

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

src/Contracts/PushesToPusher.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ public function getPusherBroadcaster(array $app)
2020
return new RedisPusherBroadcaster(
2121
new Pusher($app['key'], $app['secret'], $app['id'], config('broadcasting.connections.websockets.options', [])),
2222
$app['id'],
23-
app('redis'),
24-
config('broadcasting.connections.websockets.connection', null)
23+
app('redis')
2524
);
2625
}
2726

src/PubSub/Broadcasters/RedisPusherBroadcaster.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,18 @@ class RedisPusherBroadcaster extends Broadcaster
3535
*/
3636
protected $redis;
3737

38-
/**
39-
* The Redis connection to use for broadcasting.
40-
*
41-
* @var string|null
42-
*/
43-
protected $connection;
44-
4538
/**
4639
* Create a new broadcaster instance.
4740
*
4841
* @param Pusher $pusher
4942
* @param mixed $appId
5043
* @param \Illuminate\Contracts\Redis\Factory $redis
51-
* @param string|null $connection
5244
*/
53-
public function __construct(Pusher $pusher, $appId, Redis $redis, $connection = null)
45+
public function __construct(Pusher $pusher, $appId, Redis $redis)
5446
{
5547
$this->pusher = $pusher;
5648
$this->appId = $appId;
5749
$this->redis = $redis;
58-
$this->connection = $connection;
5950
}
6051

6152
/**
@@ -133,7 +124,9 @@ protected function decodePusherResponse($request, $response)
133124
*/
134125
public function broadcast(array $channels, $event, array $payload = [])
135126
{
136-
$connection = $this->redis->connection($this->connection);
127+
$connection = $this->redis->connection(
128+
config('websockets.replication.redis.connection') ?: 'default'
129+
);
137130

138131
$payload = json_encode([
139132
'appId' => $this->appId,

src/WebSocketsServiceProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ protected function configurePubSub()
105105
return new RedisPusherBroadcaster(
106106
$pusher,
107107
$config['app_id'],
108-
$this->app->make('redis'),
109-
$config['connection'] ?? null
108+
$this->app->make('redis')
110109
);
111110
});
112111
}

0 commit comments

Comments
 (0)