Bugfixed client reconnection logic
This commit is contained in:
parent
1255db21ab
commit
9bd53062b0
@ -53,15 +53,17 @@ class CommandBusClient implements CommandBusInterface
|
|||||||
public function close(): void
|
public function close(): void
|
||||||
{
|
{
|
||||||
$this->autoReconnect = false;
|
$this->autoReconnect = false;
|
||||||
$this->connection->close();
|
$this->connection->end();
|
||||||
$this->connection->removeAllListeners();
|
$this->connection->removeAllListeners();
|
||||||
$this->connection = null;
|
$this->connection = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function reconnect(): void
|
private function reconnect(): void
|
||||||
{
|
{
|
||||||
|
if ($this->isReconnecting) return;
|
||||||
|
|
||||||
if ($this->connection) {
|
if ($this->connection) {
|
||||||
$this->connection->close();
|
$this->connection->end();
|
||||||
$this->connection->removeAllListeners();
|
$this->connection->removeAllListeners();
|
||||||
$this->connection = null;
|
$this->connection = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user