2016-09-14 09:27:39 -05:00
|
|
|
<?php declare(strict_types = 1);
|
|
|
|
|
|
|
|
namespace Amp\Postgres;
|
|
|
|
|
|
|
|
use Interop\Async\Awaitable;
|
|
|
|
|
|
|
|
interface Connection extends Executor {
|
|
|
|
/**
|
|
|
|
* @param int $isolation
|
|
|
|
*
|
|
|
|
* @return \Interop\Async\Awaitable<\Amp\Postgres\Transaction>
|
|
|
|
*
|
|
|
|
* @throws \Amp\Postgres\FailureException
|
|
|
|
*/
|
|
|
|
public function transaction(int $isolation = Transaction::COMMITTED): Awaitable;
|
2016-09-19 11:12:32 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $channel Channel name.
|
|
|
|
*
|
|
|
|
* @return \Interop\Async\Awaitable<\Amp\Postgres\Listener>
|
|
|
|
*
|
|
|
|
* @throws \Amp\Postgres\FailureException
|
|
|
|
*/
|
|
|
|
public function listen(string $channel): Awaitable;
|
2016-09-14 09:27:39 -05:00
|
|
|
}
|