Parent

Files

Class Index [+]

Quicksearch

ActiveRecord::ConnectionAdapters::MysqlAdapter::StatementPool

Public Class Methods

new(connection, max = 1000) click to toggle source
    # File lib/active_record/connection_adapters/mysql_adapter.rb, line 95
95:         def initialize(connection, max = 1000)
96:           super
97:           @cache = Hash.new { |h,pid| h[pid] = {} }
98:         end

Public Instance Methods

[](key) click to toggle source
     # File lib/active_record/connection_adapters/mysql_adapter.rb, line 102
102:         def [](key);      cache[key]; end
[]=(sql, key) click to toggle source
     # File lib/active_record/connection_adapters/mysql_adapter.rb, line 106
106:         def []=(sql, key)
107:           while @max <= cache.size
108:             cache.shift.last[:stmt].close
109:           end
110:           cache[sql] = key
111:         end
clear() click to toggle source
     # File lib/active_record/connection_adapters/mysql_adapter.rb, line 113
113:         def clear
114:           cache.values.each do |hash|
115:             hash[:stmt].close
116:           end
117:           cache.clear
118:         end
delete(key) click to toggle source
     # File lib/active_record/connection_adapters/mysql_adapter.rb, line 104
104:         def delete(key);  cache.delete(key); end
each(&block) click to toggle source
     # File lib/active_record/connection_adapters/mysql_adapter.rb, line 100
100:         def each(&block); cache.each(&block); end
key?(key) click to toggle source
     # File lib/active_record/connection_adapters/mysql_adapter.rb, line 101
101:         def key?(key);    cache.key?(key); end
length() click to toggle source
     # File lib/active_record/connection_adapters/mysql_adapter.rb, line 103
103:         def length;       cache.length; end

Private Instance Methods

cache() click to toggle source
     # File lib/active_record/connection_adapters/mysql_adapter.rb, line 121
121:         def cache
122:           @cache[$$]
123:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.