mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Move Connections to pools namespace
This commit is contained in:
+8
-12
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Utopia\Queue;
|
||||
namespace Appwrite\Utopia\Pools;
|
||||
|
||||
use Utopia\Pools\Connection;
|
||||
|
||||
@@ -21,16 +21,6 @@ class Connections
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @return Connection
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function get(string $id): Connection
|
||||
{
|
||||
return $this->connections[$id] ?? throw new \Exception("Connection '{$id}' not found");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @return self
|
||||
@@ -41,14 +31,20 @@ class Connections
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return \count($this->connections);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return self
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function reclaim(): self
|
||||
{
|
||||
foreach ($this->connections as $connection) {
|
||||
foreach ($this->connections as $id => $connection) {
|
||||
$connection->reclaim();
|
||||
unset($this->connections[$id]);
|
||||
}
|
||||
|
||||
return $this;
|
||||
Reference in New Issue
Block a user