Skip to content

Commit

Permalink
Ignore connection push if pool closed
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Dec 11, 2017
1 parent b2b3914 commit a3c4ba5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/AbstractPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ private function pop(): \Generator {
* @throws \Error If the connection is not part of this pool.
*/
private function push(Connection $connection) {
if ($this->closed) {
return;
}

\assert(isset($this->connections[$connection]), 'Connection is not part of this pool');

if ($connection->isAlive()) {
Expand Down

0 comments on commit a3c4ba5

Please sign in to comment.