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 retry/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.12.tar.gz
(5.7 kB
view details)
Built Distribution
File details
Details for the file rampante-0.0.12.tar.gz
.
File metadata
- Download URL: rampante-0.0.12.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e6fecfb20a6e606039d057ce9bead239a5f1dce0dc10093e04e467869fcdef9 |
|
MD5 | ed0c0ba1cff3c282b736fa810dd4d043 |
|
BLAKE2b-256 | 2ccf395e13d7c197399746a6785262464dc0089e24b44ac43cb86b4cb4d4c3ff |
File details
Details for the file rampante-0.0.12-py2.py3-none-any.whl
.
File metadata
- Download URL: rampante-0.0.12-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 | ff6a43b589fcd959d66fe777fc1c4ebe65f4b5ed478cad7bfcadea4cba685c28 |
|
MD5 | 3b1e3e5b9717cc60558dcd5b6f9cc4d7 |
|
BLAKE2b-256 | aca3b9f3cc884062a5e6d17ce9aff1850f0c987d447bcb834971189732afeb24 |