Skip to content

Commit

Permalink
feat: immediately ping connection before subscribing
Browse files Browse the repository at this point in the history
  • Loading branch information
bpolaszek committed Mar 15, 2024
1 parent dd8fdee commit 999511a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Hub/Transport/Redis/RedisTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function __construct(
]);
$this->options = $resolver->resolve($options);
if ($this->options['pingInterval']) {
$this->ping();
Loop::addPeriodicTimer($this->options['pingInterval'], fn () => $this->ping());
}
$this->subscriber->on('unsubscribe', fn () => Hub::die(new RuntimeException('Redis connection lost')));
Expand Down

0 comments on commit 999511a

Please sign in to comment.