class
Circed::Network::ConnectionPool
- Circed::Network::ConnectionPool
- Reference
- Object
Overview
High-performance connection pool for IRC server connections Manages server connections efficiently with automatic cleanup
Defined in:
circed/network/connection_pool.crConstant Summary
-
CLEANUP_INTERVAL =
5.minutes
-
MAX_CONNECTIONS =
100
-
MAX_IDLE_TIME =
30.minutes
-
Connection pool configuration
Class Method Summary
-
.active_connections : Array(LinkServer)
Get all active connections
-
.add_connection(server : LinkServer)
Add a connection to the pool
-
.broadcast(message : String, exclude : Array(String) = [] of String)
Broadcast message to all connections efficiently
-
.broadcast_pattern(pattern : String, message : String)
Broadcast to specific server pattern (with wildcards)
-
.cleanup_connections
Clean up idle and dead connections
-
.force_reconnect(server_name : String) : Bool
Force reconnection for a specific server
-
.get_connection(server_name : String) : LinkServer | Nil
Get an active connection by server name
-
.health_check
Health check for all connections
-
.mark_active(server_name : String)
Mark connection as active (for keep-alive)
-
.remove_connection(server_name : String)
Remove a connection from the pool
-
.shutdown_all(reason : String = "Server shutdown")
Gracefully shutdown all connections
-
.start
Initialize the connection pool
-
.stats
Get pool statistics
- .stop
Class Method Detail
Broadcast message to all connections efficiently
def self.broadcast_pattern(pattern : String, message : String)
#
Broadcast to specific server pattern (with wildcards)
def self.get_connection(server_name : String) : LinkServer | Nil
#
Get an active connection by server name