0.1.1 增加异步程序 选择

This commit is contained in:
何全
2019-03-19 10:42:02 +08:00
parent 182460ca8e
commit f79661c783
4 changed files with 33 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
import dramatiq
import requests
from dramatiq.brokers.redis import RedisBroker
redis_broker = RedisBroker(host="127.0.0.1", port=6379)
dramatiq.set_broker(redis_broker)
@dramatiq.actor
def count_words(url):
print(url)
count_words.send("http://example.com")