Skip to content

Commit

Permalink
Re-subscribe to the scaling channel when the connection drops
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashiq committed Sep 21, 2024
1 parent 3adc873 commit 3ef9b6b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Servers/Reverb/Publishing/RedisPubSubProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ public function subscribe(): void
$this->subscribingClient->on('message', function (string $channel, string $payload) {
$this->messageHandler->handle($payload);
});

$this->subscribingClient->on('unsubscribe', function (string $channel) {
if($this->channel === $channel){
$this->subscribingClient->subscribe($channel);
}
});
}

/**
Expand Down

0 comments on commit 3ef9b6b

Please sign in to comment.