Replies: 1 comment 1 reply
-
|
Hi! I tried implement this feature as a part of FastAPI app, but it requires a lot of core changes. from fastapi import FastAPI
from propan.brokers import RabbitBroker
broker = RabbitBroker("amqp://guest:guest@localhost:5672/")
app = FastAPI()
@broker.handle("test")
async def base_handler(body):
print(body)
@app.on_event("startup")
async def start_broker():
await broker.start()
@app.on_event("shutdown")
async def stop_broker():
await broker.close()This project just created and actively grows everyday. As a creator I am opened to all thoughts about features to implement. Also I was glad to new contributors or any feedback about this project. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Question: I’m a big fan of FastAPI and Nameko, a Microservice Framework which is extremly handy for event based stuff with brokers, especially AMQP. You just annotate a function with @event_handler and it creates exchanges, queues, ..., and sets up routing. In my opinon event handling is quite different to distributed task queues such as Celery. Sadly, Nameko is bit dated, it’s based on eventlet and it was build long before type hints.
So, I’m wondering: Has anybody ever tried to combine these two concepts or is interested in working on it? I’m contemplating to give it a stab and would love to hear some thoughts about...
Cheers, Andi
Operating System
Linux
Operating System Details
No response
FastAPI Version
0.70.1
Python Version
3.9
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions