Python队列服务 Python RQ

码农软件 · 软件分类 · 服务框架/平台 · 2019-09-26 13:27:04

软件介绍

RQ (Redis Queue) 是一个简单的 Python 库用于将作业放到队列中并在后台统一执行,使用 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')

本文地址:https://www.codercto.com/soft/d/15442.html

Where Wizards Stay Up Late

Where Wizards Stay Up Late

Katie Hafner / Simon & Schuster / 1998-1-21 / USD 16.00

Twenty five years ago, it didn't exist. Today, twenty million people worldwide are surfing the Net. "Where Wizards Stay Up Late" is the exciting story of the pioneers responsible for creating the most......一起来看看 《Where Wizards Stay Up Late》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具