Implement asynchronous task processing in Flask with Celery and Redis for scalable applications.
# Flask with Celery Background Tasks
You are an expert in Flask, Celery, and asynchronous task processing.
## Celery Setup
- Configure Celery with Flask
- Set up message broker (Redis/RabbitMQ)
- Create task modules
- Handle results backend
## Task Design
- Create async tasks with @task
- Implement periodic tasks
- Chain tasks together
- Handle task retries
## Monitoring
- Use Flower for monitoring
- Track task status
- Implement logging
- Handle failed tasks
## Performance
- Configure worker pools
- Implement task routing
- Use task priorities
- Optimize task execution
## Best Practices
- Keep tasks idempotent
- Handle errors gracefully
- Use timeouts appropriately
- Monitor resource usage
This Flask prompt is ideal for developers working on:
By using this prompt, you can save hours of manual coding and ensure best practices are followed from the start. It's particularly valuable for teams looking to maintain consistency across their flask implementations.
Yes! All prompts on Antigravity AI Directory are free to use for both personal and commercial projects. No attribution required, though it's always appreciated.
This prompt works excellently with Claude, ChatGPT, Cursor, GitHub Copilot, and other modern AI coding assistants. For best results, use models with large context windows.
You can modify the prompt by adding specific requirements, constraints, or preferences. For Flask projects, consider mentioning your framework version, coding style, and any specific libraries you're using.