<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # 4.0.1 ## 主要更新 * 支持MySQL8全新的caching_sha2_password密碼驗證算法 * 增加enable_coroutine配置項,用于關閉自動創建協程 * 移除--enable-coroutine編譯配置 * 修復chan->push無法立即喚醒等待協程的問題 ## 關閉內置協程 4.0.1之前的版本,底層在Server和Timer的事件回調函數中會自動創建協程,如果回調函數中沒有使用任何協程API,這會浪費一次協程創建/銷毀操作。而且無法與1.x保持兼容。 新版本中增加了enable_coroutine配置項,可關閉內置協程。用戶可根據需要,在回調函數中自行使用Coroutine::create或go創建協程。關閉內置協程后,底層與1.x版本的行為保持了一致性,實現了100%兼容。原先使用1.x的框架,也可以直接基于4.0作為運行環境。 現在可以動態選擇是否啟用內置協程,那么--enable-coroutine編譯配置變得可有可無了。新版本中移除了該編譯選項。 ```php use Swoole\Http\Request; use Swoole\Http\Response; $http = new swoole_http_server('127.0.0.1', 9501); $http->set([ 'enable_coroutine' => false, // close build-in coroutine ]); $http->on('workerStart', function () { echo "Coroutine is " . (Co::getuid() > 0 ? 'enable' : 'disable')."\n"; }); $http->on("request", function (Request $request, Response $response) { $response->header("Content-Type", "text/plain"); if ($request->server['request_uri'] == '/co') { //關閉內置協程后,需要手工創建協程 go(function () use ($response) { $response->end("Hello Coroutine #" . Co::getuid()); }); } else { //沒有任何協程操作,這里不存在額外的協程調度開銷 $response->end("Hello Swoole #" . Co::getuid()); } }); $http->start(); ``` # 4.0.0 ## 全新協程內核 新版本4.0基于boost.context 1.60匯編代碼實現了全新的協程內核。在保存PHP函數調用棧的基礎上,增加了C棧的上下文存儲。實現了對所有PHP語法的支持。現在在任意PHP的函數,包括call_user_func、反射、魔術方法、array_map中均可使用協程。 **4.0與2.0是100%兼容的,僅重構了協程內核,API層無變更** > 4.0分支代碼升級至C++11標準,建議使用gcc-4.8或更高版本 > 僅支持php7.1及以上版本 ## 全局變量隔離 新版本中底層對全局變量進行了隔離,現在可以使用Swoole\Process創建多個Swoole\Server實例了。 ```php for ($i = 0; $i < 2; $i++) { $p = new swoole_process(function () use ($i) { $port = 9501 + $i; $http = new swoole_http_server("127.0.0.1", $port); $http->on("start", function ($server) use ($port) { echo "Swoole http server is started at http://127.0.0.1:{$port}\n"; }); $http->on("request", function ($request, $response) { $response->header("Content-Type", "text/plain"); $response->end("Hello World\n"); }); $http->start(); }, false, false); $p->start(); } ``` ### 其他更新 * 修復http2服務器無法向Chrome瀏覽器客戶端發送超過16K數據的問題 * 增加Channel->peek方法,用于窺視數據 * 修復Server->pause/resume在SWOOLE_PROCESS下無法使用的問題 * 移除Linux AIO,現在無論如何設置都使用線程池實現異步文件IO * 支持MySQL存儲過程
                  <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>

                              哎呀哎呀视频在线观看