callback = $callback; parent::__construct($container, $pool); } public function getActiveConnection() { if (! $this->connection || ! $this->check()) { $this->reconnect(); } return $this->connection; } public function reconnect(): bool { $this->connection = ($this->callback)(); $this->lastUseTime = microtime(true); return true; } public function close(): bool { $this->connection = null; return true; } }