Usage of Celery to handle song uploading via background task handling.
**Issue: ** song upload is async but still blocks the API response until processing completes. Even with async, the request remains open until the entire upload pipeline finishes, which can cause timeouts for large files or slow processing.
Implementing Celery background tasks to handle song upload processing asynchronously, improving user experience and system performance. Implementation can be done via:
- Celery Library integration with FastAPI
Benefits
- Non-blocking uploads: Users receive immediate response
- Scalability: Allows to process uploads concurrently
- Error handling: Failed uploads can be retried
- Progress tracking: Real-time upload status updates (Business Value)
Possible Solution
Using celery to decouple upload request from processing. API returns immediately with task ID while processing continues in background.
Usage of
Celeryto handle song uploading via background task handling.**Issue: ** song upload is async but still blocks the API response until processing completes. Even with async, the request remains open until the entire upload pipeline finishes, which can cause timeouts for large files or slow processing.
Implementing Celery background tasks to handle song upload processing asynchronously, improving user experience and system performance. Implementation can be done via:
Benefits
Possible Solution
Using
celeryto decouple upload request from processing. API returns immediately with task ID while processing continues in background.