Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages a single NNTP connection pool throughout the application lifecycle, enabling proper metrics accumulation. Use dependency injection to pass this around.
func New ¶
func New(cfg *config.ConfigData) (*Manager, error)
New creates a new connection pool manager with the given configuration. The pool is always created successfully, even if providers are misconfigured.
func (*Manager) Close ¶
Close gracefully shuts down the connection pool manager. This should be called during application shutdown.
func (*Manager) GetMetrics ¶
func (m *Manager) GetMetrics() (nntppool.PoolMetricsSnapshot, error)
GetMetrics returns the current metrics from the connection pool.
func (*Manager) GetPool ¶
func (m *Manager) GetPool() nntppool.UsenetConnectionPool
GetPool returns the underlying NNTP connection pool. This is the method that replaces direct calls to cfg.GetNNTPPool().
func (*Manager) UpdateConfig ¶
func (m *Manager) UpdateConfig(newCfg *config.ConfigData) error
UpdateConfig updates the connection pool with a new configuration. This properly closes the old pool first, then creates a new one to prevent resource leaks.