2017-08-02 06:01:55 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Amp\Postgres;
|
|
|
|
|
|
|
|
use Amp\Promise;
|
|
|
|
|
|
|
|
interface Link extends Executor {
|
|
|
|
/**
|
|
|
|
* @param int $isolation
|
|
|
|
*
|
|
|
|
* @return \Amp\Promise<\Amp\Postgres\Transaction>
|
|
|
|
*
|
2017-11-05 22:43:40 +01:00
|
|
|
* @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).
|
2017-08-02 06:01:55 +02:00
|
|
|
*/
|
|
|
|
public function transaction(int $isolation = Transaction::COMMITTED): Promise;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $channel Channel name.
|
|
|
|
*
|
|
|
|
* @return \Amp\Promise<\Amp\Postgres\Listener>
|
|
|
|
*
|
2017-11-05 22:43:40 +01:00
|
|
|
* @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).
|
2017-08-02 06:01:55 +02:00
|
|
|
*/
|
|
|
|
public function listen(string $channel): Promise;
|
|
|
|
}
|