/**
* @inheritDoc
*/
public function getQuery(Driver $driver, $link)
{
if (!$this->pool->contains($link)) {
throw new \OutOfBoundsException(sprintf('Undefined %s in the pooling controller.', $driver->info($link)));
}
if (!$this->waiting->isEmpty()) {
return $this->waiting->dequeue();
}
$this->idle->enqueue($link);
}