- Extracted connection management logic into a new `ConnectionManager` class, promoting separation of concerns and enhancing modularity. - Updated `BaseDataCollector` to utilize the `ConnectionManager` for connection, disconnection, and reconnection processes, improving code clarity and maintainability. - Refactored connection-related methods and attributes, ensuring consistent error handling and logging practices. - Enhanced the `OKXCollector` to implement the new connection management approach, streamlining its connection logic. - Added unit tests for the `ConnectionManager` to validate its functionality and ensure robust error handling. These changes improve the architecture of the data collector, aligning with project standards for maintainability and performance.
26 lines
740 B
Python
26 lines
740 B
Python
"""
|
|
Data collection and processing package for the Crypto Trading Bot Platform.
|
|
|
|
This package contains modules for collecting market data from various exchanges,
|
|
processing and validating the data, and storing it in the database.
|
|
"""
|
|
|
|
from .base_collector import (
|
|
BaseDataCollector, DataCollectorError, DataValidationError,
|
|
CollectorStatus, OHLCVData
|
|
)
|
|
from .common.data_types import DataType, MarketDataPoint
|
|
from .collector_manager import CollectorManager, ManagerStatus, CollectorConfig
|
|
|
|
__all__ = [
|
|
'BaseDataCollector',
|
|
'DataCollectorError',
|
|
'DataValidationError',
|
|
'DataType',
|
|
'CollectorStatus',
|
|
'MarketDataPoint',
|
|
'OHLCVData',
|
|
'CollectorManager',
|
|
'ManagerStatus',
|
|
'CollectorConfig'
|
|
] |