Class: Expedite::Server::ApplicationManager

Inherits:
Object
  • Object
show all
Defined in:
lib/expedite/server/application_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ ApplicationManager

Returns a new instance of ApplicationManager.



8
9
10
11
12
13
# File 'lib/expedite/server/application_manager.rb', line 8

def initialize(env)
  @env = env
  @pools = Hash.new do |h, k|
    h[k] = AgentPool.new(k, @env)
  end
end

Instance Attribute Details

#poolsObject (readonly)

Returns the value of attribute pools.



6
7
8
# File 'lib/expedite/server/application_manager.rb', line 6

def pools
  @pools
end

Instance Method Details

#with(name) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/expedite/server/application_manager.rb', line 15

def with(name)
  pool = @pools[name]
  target = pool.checkout
  begin
    ret = yield target
  ensure
    pool.checkin(target)
  end
  ret
end