This release introduces a comprehensive event loop management system, providing flexible strategies for handling asynchronous code in different contexts.
Major Features
Loop Management Strategies
Three different strategies are now available:
* **`current`** (default): Uses the current thread's event loop
* **`isolated`**: Creates a separate isolated loop
* **`background_thread`**: Runs a dedicated background thread with its own event loop
API Enhancements
* Added `loop_manager` central object for controlling loop strategy and execution
* Enhanced `run_coroutine_sync` function to work with the loop manager
* Updated `AsyncExitStackManager` to work with the loop manager for proper resource cleanup
Benefits
* **Flexibility**: Run async code from any context (sync functions, background threads, etc.)
* **Reliability**: Ensure resources are properly cleaned up regardless of execution context
* **Compatibility**: Work with libraries like `aiohttp` that require specific loop handling
Code Changes
* bump: from 0.6.0 to 0.7.0 (85) JasperSui
* feat: add event loop management system (84) JasperSui
**Full Changelog**: https://github.com/JasperSui/fastapi-injectable/compare/v0.6.0...v0.7.0