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