Files
seal/system/decorator/asynchronous/asynchronous.py
2019-03-19 10:42:48 +08:00

12 lines
263 B
Python

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")