You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.. instead of returning the connection right away ?
Recommended Code with its full context, as below:
if ($this->pool->isEmpty()) {
// Create more connections
if ($this->connectionCount < $this->maxActive) {
$connection = $this->createConnection(); `
// Lets push new connection to the channel as below, because channel is initialized and still have space as condition ($this->connectionCount < $this->maxActive) has evaluated to true
$ret = $this->pool->push($connection, static::CHANNEL_TIMEOUT);
if ($ret === false) {
$this->removeConnection($connection);
}
}
}
$connection = $this->pool->pop($this->maxWaitTime);
The text was updated successfully, but these errors were encountered:
Ahh so you push the connection to the channel in return() function such that if the channel is full then it means that the channel is not able to accomodate more connections therefore you remove the connection from within the same return() function.
On Line number 119 of "ConnectionPool.php" that lives in path "connection-pool/src/"
You return a new connection without pushing it into empty channel as below:
return $this->createConnection();
How about pushing this the new connection into channel (Pool) first, and then pop the connection, like below;
.. instead of returning the connection right away ?
Recommended Code with its full context, as below:
The text was updated successfully, but these errors were encountered: