https://github.com/barrachri/rampante
A nano framework for microservices
https://github.com/barrachri/rampante
asyncio microservices python-3
Last synced: 8 months ago
JSON representation
A nano framework for microservices
- Host: GitHub
- URL: https://github.com/barrachri/rampante
- Owner: barrachri
- License: other
- Created: 2017-11-19T19:17:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-09-09T05:18:52.000Z (over 2 years ago)
- Last Synced: 2024-10-11T22:18:37.866Z (over 1 year ago)
- Topics: asyncio, microservices, python-3
- Language: Python
- Homepage:
- Size: 88.9 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 11
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://badge.fury.io/py/rampante.svg
:target: https://badge.fury.io/py/rampante
:alt: PyPI version
.. image:: https://img.shields.io/pypi/pyversions/rampante.svg
:target: https://pypi.org/project/rampante/
:alt: Python Versions
.. image:: https://travis-ci.org/barrachri/rampante.svg?branch=master
:target: https://travis-ci.org/barrachri/rampante
.. image:: https://codecov.io/gh/barrachri/rampante/branch/master/graph/badge.svg
:target: https://codecov.io/gh/barrachri/rampante
🐎 Rampante
================================================
A fancy and opinionated nanoframework for microservices.
Installation
===============
.. code-block:: sh
pip install rampante
How to use `subscribe_on`
============================
.. code-block:: python
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