Method: PG::EM::ConnectionPool#connect_timeout
- Defined in:
- lib/pg/em/connection_pool.rb
#connect_timeout ⇒ Float
Set PG::EM::Client#connect_timeout on all present and future connections in this pool or read value from options
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/pg/em/connection_pool.rb', line 204 %w[connect_timeout query_timeout async_autoreconnect on_connect on_autoreconnect].each do |name| class_eval <<-EOD, __FILE__, __LINE__ def #{name}=(value) @options[:#{name}] = value b = proc { |c| c.#{name} = value } @available.each(&b) @allocated.each_value(&b) end EOD if name.start_with?('on_') class_eval <<-EOD, __FILE__, __LINE__ def #{name}(&hook) if block_given? self.#{name} = hook else @options[:#{name}] || @options['#{name}'] end end EOD else class_eval <<-EOD, __FILE__, __LINE__ def #{name} @options[:#{name}] || @options['#{name}'] end EOD end DeferredOptions.class_eval <<-EOD, __FILE__, __LINE__ def #{name}=(value) self[:#{name}=] = value end EOD end |