2016-12-30 06:21:17 +01:00
|
|
|
<?php
|
2016-09-14 16:27:39 +02:00
|
|
|
|
|
|
|
namespace Amp\Postgres;
|
|
|
|
|
2017-08-01 07:38:12 +02:00
|
|
|
use Amp\Promise;
|
|
|
|
|
2017-08-02 06:01:55 +02:00
|
|
|
interface Pool extends Link {
|
2017-08-01 07:38:12 +02:00
|
|
|
/**
|
2017-08-02 06:01:55 +02:00
|
|
|
* @return \Amp\Promise<\Amp\Postgres\Connection>
|
2017-08-01 07:38:12 +02:00
|
|
|
*/
|
|
|
|
public function getConnection(): Promise;
|
|
|
|
|
2016-09-14 16:27:39 +02:00
|
|
|
/**
|
|
|
|
* @return int Current number of connections in the pool.
|
|
|
|
*/
|
|
|
|
public function getConnectionCount(): int;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return int Current number of idle connections in the pool.
|
|
|
|
*/
|
|
|
|
public function getIdleConnectionCount(): int;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return int Maximum number of connections.
|
|
|
|
*/
|
|
|
|
public function getMaxConnections(): int;
|
|
|
|
}
|