This class maintains a pool of connections, to reduce the overhead of starting and closing down connections for each method call.
This class is used internally by
DRbObject. The user does not normally need to deal with it directly.
# File lib/drb/drb.rb, line 1258 def self.make_pool ThreadObject.new do |queue| pool =  while true queue._execute do |message| case(message) when :take then remote_uri = message conn = nil new_pool =  pool.each do |c| if conn.nil? and c.uri == remote_uri conn = c if c.alive? else new_pool.push c end end pool = new_pool conn when :store then conn = message pool.unshift(conn) pool.pop.close while pool.size > POOL_SIZE conn else nil end end end end end
# File lib/drb/drb.rb, line 1291 def self.stop_pool @pool_proxy&.kill @pool_proxy = nil end
Ruby Core © 1993–2020 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.