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