public function fetch() { while (!empty($this->pool)) { $conn = array_pop($this->pool); if ($conn->isConnected()) { if ($conn->count === 0) { swoole_timer_clear($conn->timer); $conn->timer = null; $conn->wakeup(); } return $conn; } } return null; }