微服务纳米框架。
rampante的Python项目详细描述
斜坡
用于微服务的奇特且固执己见的纳米框架。
安装
pip install rampante
如何使用订阅
fromrampanteimportsubscribe_on# The function should accept 3 params# queue_name, for example could be "user.subscribed"# data is a dictionary, it's a msgpacked message sent to NATS# app, aiohttp app instance (in case)@subscribe_on("user.subscribed")asyncdefsend_a_message(queue_name,data,app):log.info("Event received!")@subscribe_on("user.subscribed","user.created")asyncdefsend_another_message(queue_name,data,app):log.info("Event received!")
示例
检查文件夹中的示例!
您需要运行NATS流:0.6.0,请检查生成文件:)
名称
Rampante在意大利语中是“猖獗”的意思。
为什么是nats?
它是用围棋写的,看起来效果很好!
待办事项
- 任务失败时添加重试/逻辑
鼓励拉取请求!
许可证
阿帕奇2.0