Class: ZK::Pool::Simple
Overview
create a connection pool useful for multithreaded applications
Will spin up number_of_connections at creation time and remain fixed at
that number for the life of the pool.
Constant Summary
Constant Summary
Constants inherited from Bounded
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (ZK::ClientPool) initialize(host, number_of_connections = 10, opts = {})
constructor
initialize a connection pool using the same optons as ZK.new.
Methods inherited from Bounded
#add_connection!, #available_size, #checkin, #checkout, #count_waiters, #create_connection, #handle_checkin_on_connection, #populate_pool!, #size
Methods inherited from Base
#assert_open!, #close_all!, #closed?, #closing?, #forced?, #locker, #method_missing, #open?, #pool_state, #size, #synchronize, #with_connection, #with_lock
Constructor Details
- (ZK::ClientPool) initialize(host, number_of_connections = 10, opts = {})
initialize a connection pool using the same optons as ZK.new
315 316 317 318 319 320 |
# File 'lib/zk/pool.rb', line 315 def initialize(host, number_of_connections=10, opts = {}) opts = opts.dup opts[:max_clients] = opts[:min_clients] = number_of_connections.to_i super(host, opts) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ZK::Pool::Base