teamhide / fastapi-boilerplate

FastAPI boilerplate for real world production
1.12k stars 178 forks source link

Comprehensive Celery Integration Enhancement in FastAPI Boilerplate #39

Open marcosmamorim opened 5 months ago

marcosmamorim commented 5 months ago

Comprehensive Celery Integration Enhancement in FastAPI Boilerplate

Overview

This PR introduces a significant enhancement to the Celery integration mechanism within the FastAPI Boilerplate project. The changes aim to streamline task management and improve the efficiency of background task processing by sharing database session configurations between FastAPI and Celery components.

Key Changes

Benefits

Usage Example

With the new setup, adding a new module with background tasks only requires adding a tasks.py file in the correct directory. The system automatically handles the rest, setting up queues and ensuring the tasks are correctly routed and executed.