Improvements:
**1. Enhanced Thread Safety:**
* Implemented thread-local storage for connections, ensuring that each thread uses its own dedicated RabbitMQ connection.
* Resolved issues related to concurrent access of shared connections, significantly improving stability in multi-threaded environments.
**2. Improved Connection Management:**
* Introduced a more robust connection handling mechanism with automatic reconnection capabilities.
* Enhanced error handling for connection failures, reducing the likelihood of service interruptions.
**3. Optimized Consumer Threading:**
* Redesigned consumer implementation to use separate threads for each queue, improving parallelism and reducing the risk of blocking operations.
Bug Fixes:
**1. StreamLostError Handling:**
* Addressed the `StreamLostError` that occurred when connections were unexpectedly closed, implementing graceful reconnection logic.
**2. Thread-related IndexError Resolution:**
* Fixed the `IndexError('pop from an empty deque')` that was occurring due to thread-unsafe operations on shared resources.
Notes:
This release significantly enhances the thread safety and connection reliability of ApexMQ. It addresses critical issues that were causing instability in multi-threaded environments and improves the overall robustness of the library. Users are strongly encouraged to update to this version for a more stable and efficient messaging experience, especially in applications with concurrent operations.