Python3的后台处理。
remoulade的Python项目详细描述
去除
一个快速可靠的python 3分布式任务处理库。
changelog:https://remoulade.readthedocs.io/changelog.html
文档:https://remoulade.readthedocs.io
安装
如果要与RabbitMQ一起使用
pipenv install 'remoulade[rabbitmq, watch]'
或者如果你想和Redis一起使用
pipenv install 'remoulade[redis, watch]'
快速启动
确保运行了RabbitMQ,然后创建一个名为
example.py
:
importremouladeimportrequestsimportsys@remoulade.actordefcount_words(url):response=requests.get(url)count=len(response.text.split(" "))print(f"There are {count} words at {url!r}.")if__name__=="__main__":count_words.send(sys.argv[1])
在一个终端中,运行您的工人:
remoulade example
在另一个队列中,开始排队消息:
python example.py http://example.com
python example.py https://github.com
python example.py https://news.ycombinator.com
查看user guide了解更多!
许可证
Remoulade根据LGPL获得许可。请看COPYING和 COPYING.LESSER获取授权详细信息。