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

图论——一个迷人的世界

图论——一个迷人的世界

本杰明,查特兰,张萍 / 机械工业出版社 / 2001-1-1

本书介绍了图论的基本概念,解释了图论中各种经典问题。例如,熄灯的问题、小生成树问题、哥尼斯堡七桥问题、中国邮递员问题、国际象棋中马的遍历问题和路的着色问题等等。书中也给出了各种类型的图,例如,二部图、欧拉图、彼得森图和树;等等。每一章都为读者设置了练习题,包含了具有挑战性的探索性问题。一起来看看 《图论——一个迷人的世界》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

html转js在线工具
html转js在线工具

html转js在线工具