Class: TieredCaching::SafeConnectionPool

Inherits:
Object
  • Object
show all
Defined in:
lib/tiered_caching/safe_connection_pool.rb

Instance Method Summary collapse

Constructor Details

#initialize(internal_pool, &recovery_callback) ⇒ SafeConnectionPool

Returns a new instance of SafeConnectionPool.



3
4
5
6
# File 'lib/tiered_caching/safe_connection_pool.rb', line 3

def initialize(internal_pool, &recovery_callback)
  @internal_pool = internal_pool
  @recovery_callback = recovery_callback
end

Instance Method Details

#disabled?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/tiered_caching/safe_connection_pool.rb', line 16

def disabled?
  !!@disabled
end

#enable!Object



12
13
14
# File 'lib/tiered_caching/safe_connection_pool.rb', line 12

def enable!
  @disabled = false
end

#with(&block) ⇒ Object



8
9
10
# File 'lib/tiered_caching/safe_connection_pool.rb', line 8

def with(&block)
  @internal_pool.with { |conn| safe_with(conn, &block) }
end