class Circed::Network::ConnectionPool

Overview

High-performance connection pool for IRC server connections Manages server connections efficiently with automatic cleanup

Defined in:

circed/network/connection_pool.cr

Constant Summary

CLEANUP_INTERVAL = 5.minutes
MAX_CONNECTIONS = 100
MAX_IDLE_TIME = 30.minutes

Connection pool configuration

Class Method Summary

Class Method Detail

def self.active_connections : Array(LinkServer) #

Get all active connections


[View source]
def self.add_connection(server : LinkServer) #

Add a connection to the pool


[View source]
def self.broadcast(message : String, exclude : Array(String) = [] of String) #

Broadcast message to all connections efficiently


[View source]
def self.broadcast_pattern(pattern : String, message : String) #

Broadcast to specific server pattern (with wildcards)


[View source]
def self.cleanup_connections #

Clean up idle and dead connections


[View source]
def self.force_reconnect(server_name : String) : Bool #

Force reconnection for a specific server


[View source]
def self.get_connection(server_name : String) : LinkServer | Nil #

Get an active connection by server name


[View source]
def self.health_check #

Health check for all connections


[View source]
def self.mark_active(server_name : String) #

Mark connection as active (for keep-alive)


[View source]
def self.remove_connection(server_name : String) #

Remove a connection from the pool


[View source]
def self.shutdown_all(reason : String = "Server shutdown") #

Gracefully shutdown all connections


[View source]
def self.start #

Initialize the connection pool


[View source]
def self.stats #

Get pool statistics


[View source]
def self.stop #

[View source]