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.11.tar.gz
(5.7 kB
view details)
Built Distribution
File details
Details for the file rampante-0.0.11.tar.gz
.
File metadata
- Download URL: rampante-0.0.11.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 737c6c34bff1b32b08ec25dcbc91e83013ffa8f02bf4de39ec715eb127da86d6 |
|
MD5 | 4a2d198805844e682d05f670b61aad41 |
|
BLAKE2b-256 | e6d97724f251bc0b2b39b5d92b4015d62c3a7f0df0b826b507e88a4f6826d47f |
File details
Details for the file rampante-0.0.11-py2.py3-none-any.whl
.
File metadata
- Download URL: rampante-0.0.11-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 | d68a6f07b03860b9b78e0caa5f8eee4c4ee63c89ae76d4225dd7ac666ea305dc |
|
MD5 | bca8189c767eee1a8b4dfca154f6c72f |
|
BLAKE2b-256 | 6e64bf456d7c60dc1bc865aea675b523f9140ace0e259b698eb5eda986564ee7 |