A fancy and opinionated nanoframework for microservices.
pip install rampante
from rampante import subscribe_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")
async def send_a_message(queue_name, data, app):
log.info("Event received!")
@subscribe_on("user.subscribed", "user.created")
async def send_another_message(queue_name, data, app):
log.info("Event received!")
Check the examples inside the folder!
You need a nats-streaming:0.6.0 running, check the Makefile :)
Rampante means "rampant" in Italian.
It's written in Go and seems working really well!
- add retry/logic when tasks fail
Pull requests are encouraged!
Apache 2.0