diff --git a/src/CommandBusClient.php b/src/CommandBusClient.php index 22a95dd..09bbd92 100644 --- a/src/CommandBusClient.php +++ b/src/CommandBusClient.php @@ -53,15 +53,17 @@ class CommandBusClient implements CommandBusInterface public function close(): void { $this->autoReconnect = false; - $this->connection->close(); + $this->connection->end(); $this->connection->removeAllListeners(); $this->connection = null; } private function reconnect(): void { + if ($this->isReconnecting) return; + if ($this->connection) { - $this->connection->close(); + $this->connection->end(); $this->connection->removeAllListeners(); $this->connection = null; }