Dev/python

파이썬 flask - redis - celery 구조

lumination 2024. 3. 14. 14:05

파이썬

Flask webframework

redis broker

celery async worker

 

구조로 사용할 것이다.

title excel upload api

participant User
participant Web App (Flask)
participant Redis
participant Celery Worker
participant DB

User->Web App (Flask):GET /excel
User<--Web App (Flask):response
User->Web App (Flask):POST /excel/upload

Web App (Flask)->Redis:Enqueue a new task to the broker
Redis<-Celery Worker:Worker picks up task from queue
Celery Worker->DB:Update result
User->Web App (Flask):Check the status of the task
User<--Web App (Flask):response