In the following code only gc_collect_cycles() prevents the Pool to run out of connections, otherwise connections don't get released on time. I believe Connection has to be released when the ResultSet reaches its end, not only on ResultSet destruction.
while (true) {
$resultSet = yield $pool->query("SELECT 1");
yield \Amp\Iterator\toArray($resultSet);
gc_collect_cycles();
yield new Delayed(5000);
}
In the following code only
gc_collect_cycles()prevents thePoolto run out of connections, otherwise connections don't get released on time. I believeConnectionhas to be released when theResultSetreaches its end, not only onResultSetdestruction.