1
0
mirror of https://github.com/danog/postgres.git synced 2024-11-26 20:15:02 +01:00
postgres/lib/Link.php
2017-11-05 15:43:40 -06:00

30 lines
1.1 KiB
PHP

<?php
namespace Amp\Postgres;
use Amp\Promise;
interface Link extends Executor {
/**
* @param int $isolation
*
* @return \Amp\Promise<\Amp\Postgres\Transaction>
*
* @throws \Amp\Postgres\FailureException If the operation fails due to unexpected condition.
* @throws \Amp\Postgres\ConnectionException If the connection to the database is lost.
* @throws \Amp\Postgres\QueryError If the operation fails due to an error in the query (such as a syntax error).
*/
public function transaction(int $isolation = Transaction::COMMITTED): Promise;
/**
* @param string $channel Channel name.
*
* @return \Amp\Promise<\Amp\Postgres\Listener>
*
* @throws \Amp\Postgres\FailureException If the operation fails due to unexpected condition.
* @throws \Amp\Postgres\ConnectionException If the connection to the database is lost.
* @throws \Amp\Postgres\QueryError If the operation fails due to an error in the query (such as a syntax error).
*/
public function listen(string $channel): Promise;
}