lib/garcon/task/thread_pool/executor.rb
# Scan all threads in the pool and reclaim any that are dead or
# have been idle too long. Will check the last time the pool was
# pruned and only run if the configured garbage collection
# interval has passed.
#
# @!visibility private
Scan all threads in the pool and reclaim any that are dead or
have been idle too long. Will check the last time the pool was
pruned and only run if the configured garbage collection
interval has passed.
Scan all threads in the pool and reclaim any that are dead or have been idle too long . Will check the last time the pool was pruned and only run if the configured garbage collection interval has passed .
def prune_pool
      if Garcon.monotonic_time - @gc_interval >= @last_gc_time
        @pool.delete_if { |worker| worker.dead? }
        @pool.select { |worker| @idletime != 0 &&
          Garcon.monotonic_time - @idletime > worker.last_activity
        }.each { @queue << :stop }
        @last_gc_time = Garcon.monotonic_time
      end
    end
def prune_pool if Garcon . monotonic_time - @gc_interval >= @last_gc_time @pool . delete_if { | worker | worker . dead? } @pool . select { | worker | @idletime != 0 && Garcon . monotonic_time - @idletime > worker . last_activity } . each { @queue << :stop } @last_gc_time = Garcon . monotonic_time end end
Scan all threads in the pool and reclaim any that are dead or
have been idle too long.
Scan all threads in the pool and reclaim any that are dead or have been idle too long .
# send :stop for each thread over idletime
!visibility
None