class Session::ConnectionPool

Overview

Simple connection pool for Redis connections

Defined in:

connection_pool.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(config : ConnectionPoolConfig = ConnectionPoolConfig.new) #

[View source]

Instance Method Detail

def available : Int32 #

[View source]
def checkin(conn : Redis) : Nil #

Return a connection to the pool


[View source]
def checkout : Redis #

Check out a connection from the pool


[View source]
def config : ConnectionPoolConfig #

[View source]
def healthy? : Bool #

Check if pool is healthy (at least one connection works)


[View source]
def shutdown : Nil #

Close all connections and shutdown the pool


[View source]
def size : Int32 #

[View source]
def stats : NamedTuple(size: Int32, available: Int32, in_use: Int32) #

Get pool statistics


[View source]
def with_connection(&block : Redis -> T) : T forall T #

Execute a block with a pooled connection


[View source]