1
0
mirror of https://github.com/danog/postgres.git synced 2024-12-15 19:07:26 +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;
}