Class: Routemaster::Cache::Pool

Inherits:
SimpleDelegator
  • Object
show all
Includes:
Singleton
Defined in:
lib/routemaster/cache.rb

Overview

A pool of threads, used for parallel/future request processing.

Instance Method Summary collapse

Constructor Details

#initializePool

Returns a new instance of Pool.



28
29
30
31
32
33
34
35
# File 'lib/routemaster/cache.rb', line 28

def initialize
  Thread.pool(5, 20).tap do |p|
    # TODO: configurable pool size and trim timeout?
    p.auto_trim!
    p.idle_trim! 10 # 10 seconds
    super p
  end
end