import dramatiq
from dramatiq.brokers.redis import RedisBroker
from dramatiq.results import Results
from dramatiq.results.backends import RedisBackend
broker = RedisBroker(host="127.0.0.1", port=6379)
broker.declare_queue("default")
dramatiq.set_broker(broker)
# backend = RedisBackend()
# broker.add_middleware(Results(backend=backend))
@dramatiq.actor()
def print_words(text):
print('This is ' + text)
print_words('sync')
a = print_words.send('async')
a.get_results()
我正在检查芹菜的替代品,发现了 Dramatiq。我刚刚开始使用 Dramatiq,但无法检索结果。我什至尝试将后端和“save_results”设置为 True。我总是得到这个AttributeError: 'Message' object has no attribute 'get_results'
关于如何获得结果的任何想法?