lib/oedipus/connection/pool.rb
# Close connections past their ttl (runs in a new Thread)
Close connections past their ttl (runs in a new Thread)
Close connections past their ttl ( runs in a new Thread )
def sweeper
        Thread.new(@expiries, @available) do |exp, avail|
          loop do
            sleep 15
            @lock.synchronize {
              avail.each do |instance|
                if exp[instance] < Time.now
                  avail.delete(instance)
                  exp.delete(instance)
                  instance.close
                end
              end
            }
          end
        end
      end
def sweeper Thread . new ( @expiries , @available ) do | exp , avail | loop do sleep 15 @lock . synchronize { avail . each do | instance | if exp [ instance ] < Time . now avail . delete ( instance ) exp . delete ( instance ) instance . close end end } end end end
Close connections past their ttl (runs in a new Thread)
Close connections past their ttl ( runs in a new Thread )