Add concurrent anime processing support

- Modified BackgroundLoaderService to use multiple workers (default: 5)
- Anime additions now process in parallel without blocking
- Added comprehensive unit tests for concurrent behavior
- Updated integration tests for compatibility
- Updated architecture documentation
This commit is contained in:
2026-01-24 17:42:59 +01:00
parent 04f26d5cfc
commit 8ff558cb07
6 changed files with 530 additions and 843 deletions

View File

@@ -1,8 +1,41 @@
# Asynchronous Series Data Loading Architecture
**Version:** 1.0
**Date:** 2026-01-18
**Status:** Planning Phase
**Version:** 2.0
**Date:** 2026-01-24
**Status:** ✅ Implemented with Concurrent Processing
## ⚡ Update 2.0 - Concurrent Processing (2026-01-24)
**Enhancement**: Added support for concurrent processing of multiple anime additions.
### Changes Made
1. **Multiple Worker Architecture**:
- Changed from single worker to configurable multiple workers (default: 5)
- Multiple anime can now be processed simultaneously
- Non-blocking queue processing allows immediate response to additional requests
2. **Backward Compatibility**:
- All existing APIs remain unchanged
- Drop-in replacement for single-worker implementation
- Tests updated to reflect concurrent behavior
3. **Configuration**:
- `max_concurrent_loads` parameter added to control worker count
- Default set to 5 concurrent loads for optimal balance
4. **Performance Impact**:
- Multiple anime additions now process in parallel
- No blocking when adding second anime while first is loading
- Each worker processes tasks independently from queue
### Migration Notes
- **Attribute Change**: `worker_task``worker_tasks` (now a list)
- **Stop Behavior**: Gracefully stops all workers with proper cleanup
- **Tests**: Updated to verify concurrent processing
---
## Table of Contents