<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Python RQPython隊列服務(wù)

          聯(lián)合創(chuàng)作 · 2023-09-30 05:17

          RQ (Redis Queue) 是一個簡單的 Python 庫用于將作業(yè)放到隊列中并在后臺統(tǒng)一執(zhí)行,使用 Redis 做后端,可方便的跟 Web 前端集成。

          示例代碼:

          import requests
          
          def count_words_at_url(url):
              resp = requests.get(url)
              return len(resp.text.split())
          

          Then, create a RQ queue:

          from rq import Queue, use_connection
          use_connection()
          q = Queue()
          

          And enqueue the function call:

          from my_module import count_words_at_url
          result = q.enqueue(
                       count_words_at_url, 'http://nvie.com')
          
          瀏覽 14
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  国精产品一品二品国精品69XX | 一本色道久久综合亚洲精品小说 | 亚洲性爱网络 | 国产乱伦小视频 | 北条麻妃网址 |