mirror of
https://github.com/hequan2017/seal.git
synced 2026-04-25 19:20:47 +08:00
0.1.1 增加异步程序 选择
This commit is contained in:
0
system/decorator/asynchronous/__init__.py
Normal file
0
system/decorator/asynchronous/__init__.py
Normal file
12
system/decorator/asynchronous/asynchronous.py
Normal file
12
system/decorator/asynchronous/asynchronous.py
Normal 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")
|
||||
Reference in New Issue
Block a user