1
0
mirror of https://github.com/danog/postgres.git synced 2024-11-30 04:29:12 +01:00

Update for Amp changes

Listener → StreamIterator
Promise\map() removed
This commit is contained in:
Aaron Piotrowski 2017-04-14 18:32:57 -05:00
parent e8e3ea7f7b
commit c11beb79a2
3 changed files with 9 additions and 7 deletions

View File

@ -2,9 +2,9 @@
namespace Amp\Postgres;
use Amp\{ Listener as StreamListener, Promise, Stream };
use Amp\{ Promise, Stream, StreamIterator };
class Listener extends StreamListener implements Operation {
class Listener extends StreamIterator implements Operation {
use Internal\Operation;
/** @var string */

View File

@ -2,9 +2,9 @@
namespace Amp\Postgres;
use Amp\Listener;
use Amp\StreamIterator;
abstract class TupleResult extends Listener implements Result {
abstract class TupleResult extends StreamIterator implements Result {
/**
* Returns the number of fields (columns) in each row.
*

View File

@ -173,9 +173,11 @@ abstract class AbstractPoolTest extends \PHPUnit_Framework_TestCase {
for ($i = 0; $i < $count * $rounds; ++$i) {
$promises[] = $pool->transaction(Transaction::COMMITTED);
}
yield Promise\all(Promise\map(function (Transaction $transaction) {
return $transaction->rollback();
yield Promise\all(\array_map(function (Promise $promise) {
return Promise\pipe($promise, function (Transaction $transaction) {
return $transaction->rollback();
});
}, $promises));
});
}