mirror of
https://github.com/danog/postgres.git
synced 2024-11-27 04:24:45 +01:00
26 lines
566 B
PHP
26 lines
566 B
PHP
<?php
|
|
|
|
namespace Amp\Postgres;
|
|
|
|
use Amp\Promise;
|
|
|
|
interface Connection extends Executor {
|
|
/**
|
|
* @param int $isolation
|
|
*
|
|
* @return \Amp\Promise<\Amp\Postgres\Transaction>
|
|
*
|
|
* @throws \Amp\Postgres\FailureException
|
|
*/
|
|
public function transaction(int $isolation = Transaction::COMMITTED): Promise;
|
|
|
|
/**
|
|
* @param string $channel Channel name.
|
|
*
|
|
* @return \Amp\Promise<\Amp\Postgres\Listener>
|
|
*
|
|
* @throws \Amp\Postgres\FailureException
|
|
*/
|
|
public function listen(string $channel): Promise;
|
|
}
|