update interfaces

This commit is contained in:
prolic 2018-06-29 17:22:16 +08:00
parent 57d72761cb
commit a36a41ab06
No known key found for this signature in database
GPG Key ID: 29722F9F48E9DE59
3 changed files with 7 additions and 22 deletions

View File

@ -1,21 +0,0 @@
<?php
namespace Amp\Sql;
use Amp\CancellationToken;
use Amp\Promise;
interface Connection extends Link {
/**
* @param ConnectionConfig $config
* @param CancellationToken|null $token
*
* @return Promise<Connection>
*/
public static function connect(ConnectionConfig $config, CancellationToken $token = null): Promise;
/**
* @return int Timestamp of the last time this connection was used.
*/
public function lastUsedAt(): int;
}

View File

@ -2,6 +2,7 @@
namespace Amp\Sql; namespace Amp\Sql;
interface ConnectionConfig { interface ConnectionConfig
{
public function connectionString(): string; public function connectionString(): string;
} }

View File

@ -46,6 +46,11 @@ interface Executor {
*/ */
public function isAlive(): bool; public function isAlive(): bool;
/**
* @return int Timestamp of the last time this connection was used.
*/
public function lastUsedAt(): int;
/** /**
* Closes the executor. No further queries may be performed. * Closes the executor. No further queries may be performed.
*/ */