A microservices nanoframework.
Project description
🐎 Rampante
A fancy and opinionated nanoframework for microservices.
Installation
pip install rampante
How to use subscribe_on
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!")
Example
Check the examples inside the folder!
You need a nats-streaming:0.6.0 running, check the Makefile :)
The name
Rampante means “rampant” in Italian.
Why NATS?
It’s written in Go and seems working really well!
To Do
add circuit breaker
add retry
add logic when tasks fail
Pull requests are encouraged!
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rampante-0.0.9.tar.gz
(5.6 kB
view details)
Built Distribution
File details
Details for the file rampante-0.0.9.tar.gz
.
File metadata
- Download URL: rampante-0.0.9.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da9c1237ecfd33755205a225dd57f3f7925c1f842599bcf4c577568caf05774c |
|
MD5 | 97e8be0bd26947be90ee02accf58b05a |
|
BLAKE2b-256 | 8ff28494ae1dc818f468f01d25adc8b06f566b6b3651839623a503c9556be47a |
File details
Details for the file rampante-0.0.9-py2.py3-none-any.whl
.
File metadata
- Download URL: rampante-0.0.9-py2.py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cf6916b8ed324e92acc95fa60d73e01434bd0e736aeba1531ba9b57fd93b02a |
|
MD5 | 02ef3144fa3d78089fbe5afd922f62d9 |
|
BLAKE2b-256 | 048cf386d26b4e464c16f9555b34c0e9affc08f67e37a495d1bf8ee1d9629403 |