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.14.tar.gz
(5.7 kB
view details)
Built Distribution
File details
Details for the file rampante-0.0.14.tar.gz
.
File metadata
- Download URL: rampante-0.0.14.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5775ea51d4f872601d0f4e73400d2614b63b179c8d554babf218c4b9a19b43ca |
|
MD5 | d712ee2c9cf94d3ed637dd6e594161c8 |
|
BLAKE2b-256 | 01a3a9dd97f3e8a6abd3d0e5f9f8314688d6e5ca73dd6df350101c4ad546ef8c |
File details
Details for the file rampante-0.0.14-py2.py3-none-any.whl
.
File metadata
- Download URL: rampante-0.0.14-py2.py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6334e3298c2c8707b6ad19eb0a5ba7532d55a0f8b58927bfa66201f18e2bc36 |
|
MD5 | 89ef6a9e60e19e26a5cc82bc5c2f551a |
|
BLAKE2b-256 | 482c72d8bd6312ead10f435586867b5f7a1be3f6ec807f3ce2b290743733b84f |