2016-12-30 06:21:17 +01:00
|
|
|
<?php
|
2016-09-14 16:27:39 +02:00
|
|
|
|
|
|
|
namespace Amp\Postgres;
|
|
|
|
|
2017-01-18 18:05:05 +01:00
|
|
|
use AsyncInterop\Promise;
|
2016-09-14 16:27:39 +02:00
|
|
|
|
|
|
|
interface Connection extends Executor {
|
|
|
|
/**
|
|
|
|
* @param int $isolation
|
|
|
|
*
|
2017-01-18 18:05:05 +01:00
|
|
|
* @return \AsyncInterop\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.
|
|
|
|
*
|
2017-01-18 18:05:05 +01:00
|
|
|
* @return \AsyncInterop\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
|
|
|
}
|