Skip to content

Commit

Permalink
Added getWorkers() to pool
Browse files Browse the repository at this point in the history
  • Loading branch information
marinhekman authored and mmoreram committed Apr 14, 2022
1 parent 92b065b commit fd55f3a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/ConnectionPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/**
* Class ConnectionPool.
*/
class ConnectionPool implements Connection
class ConnectionPool implements Connection, ConnectionPoolInterface
{
private array $connections;

Expand Down Expand Up @@ -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;
}
}
13 changes: 13 additions & 0 deletions src/ConnectionPoolInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Drift\DBAL;

interface ConnectionPoolInterface
{
/**
* Get the Pool's connection workers
*
* @return ConnectionWorker[]
*/
public function getWorkers(): array;
}

0 comments on commit fd55f3a

Please sign in to comment.