<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ~~~ <?php /** * Created by PhpStorm. * User: Administrator * Date: 2020/12/29 * Time: 14:55 */ namespace lib; class RedisPool{ protected $available = true; public $pool; protected $redis_host='127.0.0.1'; protected $redis_port=6379; protected $redis_auth=''; public function __construct(){ //pop()函數移除棧頂元素 //push() 在末尾加入一個元素 $this->pool = new SplQueue; } public function get() { //有空閑連接且連接池處于可用狀態 if ($this->available && count($this->pool) > 0) { $redis = $this->pool->pop(); } else { if(count($this->pool) >= 1000){ return false; } //無空閑連接,創建新連接 $redis = new Redis(); $redis->connect($this->redis_host, $this->redis_port); if ($this->redis_auth) { $redis->auth($this->redis_auth); } } return $redis; } public function put($redis){ $this->pool->push($redis); } public function destruct() { // 連接池銷毀, 置不可用狀態, 防止新的客戶端進入常駐連接池, 導致服務器無法平滑退出 $this->available = false; while (!$this->pool->isEmpty()) { $this->pool->pop(); } } } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看