Python 分布式任务处理库 Dramatiq

码农软件 · 软件分类 · 作业/任务调度 · 2019-09-04 08:27:48

软件介绍

Dramatiq 是一个 Python 3 (3.5或更高版本)分布式任务处理库,特点是简单、可靠和高性能。

Demo

import dramatiq
import requests

@dramatiq.actor
def count_words(url):
   response = requests.get(url)
   count = len(response.text.split(" "))
   print(f"There are {count} words at {url!r}.")

# Synchronously count the words on example.com in the current process
count_words("http://example.com")

# or send the actor a message so that it may perform the count
# later, in a separate process.
count_words.send("http://example.com")

使用

与 RabbitMQ 一起使用:

$ pip install -U dramatiq[rabbitmq, watch]

与 Redis 一起使用:

$ pip install -U dramatiq[redis, watch]

具体使用方法阅读 Motivation 或 User Guide

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

数据结构 Python语言描述

数据结构 Python语言描述

[美] Kenneth A. Lambert 兰伯特 / 李军 / 人民邮电出版社 / 2017-12-1 / CNY 69.00

在计算机科学中,数据结构是一门进阶性课程,概念抽象,难度较大。Python语言的语法简单,交互性强。用Python来讲解数据结构等主题,比C语言等实现起来更为容易,更为清晰。 《数据结构 Python语言描述》第1章简单介绍了Python语言的基础知识和特性。第2章到第4章对抽象数据类型、数据结构、复杂度分析、数组和线性链表结构进行了详细介绍,第5章和第6章重点介绍了面向对象设计的相关知识、......一起来看看 《数据结构 Python语言描述》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试