teamhide / fastapi-boilerplate

FastAPI boilerplate for real world production
986 stars 156 forks source link

Comprehensive Celery Integration Enhancement in FastAPI Boilerplate #39

Open marcosmamorim opened 2 months ago

marcosmamorim commented 2 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.