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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # Select多路選擇器 ## 多路選擇器的功能介紹 比如我們有ABCD四個任務,我們希望這4個任務并發的執行,最后誰返回的結果最快我們便選擇那個結果,不等待其余任務的結果返回,不堵塞。 下面提供一個操作實例 ```php /** * select方法測試 * @return \Generator */ public function http_test_select() { yield $this->redis_pool->getCoroutine()->set('test', 1); $c1 = $this->redis_pool->getCoroutine()->get('test'); $c2 = $this->redis_pool->getCoroutine()->get('test1'); $result = yield SelectCoroutine::Select(function ($result) { if ($result != null) { return true; } return false; }, $c2, $c1); $this->http_output->end($result); } ``` Select函數原型 ```php function Select($matchFunc, CoroutineBase ...$coroutines) ``` SelectCoroutine::Select函數可以接受n個參數,第一個參數是匹配函數用于篩選,如果結果滿足便返回true否則返回false,第二到n個參數為CoroutineBase。 上述代碼將在c1,c2中選擇一個最快速的非null的值。得到需要結果后不會繼續等待其他的結果。 需要注意的是每個協程都有擁有超時限制,這里SelectCoroutine在超時時間內沒有獲得符合條件的結果將會報超時錯誤。
                  <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>

                              哎呀哎呀视频在线观看