sql/src/Pool.php

34 lines
733 B
PHP
Raw Normal View History

2018-06-26 13:14:24 +02:00
<?php
namespace Amp\Sql;
use Amp\Promise;
2018-06-29 12:15:39 +02:00
interface Pool extends Link
{
2018-06-26 13:14:24 +02:00
/**
* @return Promise<Link>
2018-06-26 13:14:24 +02:00
*/
public function extractConnection(): Promise;
2018-06-26 13:14:24 +02:00
/**
* @return int Total number of active connections in the pool.
*/
2018-06-26 13:14:24 +02:00
public function getConnectionCount(): int;
/**
* @return int Total number of idle connections in the pool.
*/
2018-06-26 13:14:24 +02:00
public function getIdleConnectionCount(): int;
/**
* @return int Maximum number of connections this pool will create.
2018-06-26 13:14:24 +02:00
*/
2018-09-13 20:51:10 +02:00
public function getConnectionLimit(): int;
/**
* @return int Number of seconds a connection may remain idle before it is automatically closed.
*/
public function getIdleTimeout(): int;
2018-06-26 13:14:24 +02:00
}