From fd55f3a16d4b526dcbcc525407089d3d500179a9 Mon Sep 17 00:00:00 2001 From: Marin Date: Tue, 12 Apr 2022 13:48:13 +0200 Subject: [PATCH] Added getWorkers() to pool --- src/ConnectionPool.php | 12 +++++++++++- src/ConnectionPoolInterface.php | 13 +++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 src/ConnectionPoolInterface.php diff --git a/src/ConnectionPool.php b/src/ConnectionPool.php index 10e6fd1..466a57b 100644 --- a/src/ConnectionPool.php +++ b/src/ConnectionPool.php @@ -28,7 +28,7 @@ /** * Class ConnectionPool. */ -class ConnectionPool implements Connection +class ConnectionPool implements Connection, ConnectionPoolInterface { private array $connections; @@ -421,4 +421,14 @@ public function truncateTable(string $name): PromiseInterface return $connection->truncateTable($name); }); } + + /** + * Get the Pool's connection workers + * + * @return ConnectionWorker[] + */ + public function getWorkers(): array + { + return $this->connections; + } } diff --git a/src/ConnectionPoolInterface.php b/src/ConnectionPoolInterface.php new file mode 100644 index 0000000..d90eb31 --- /dev/null +++ b/src/ConnectionPoolInterface.php @@ -0,0 +1,13 @@ +