Class: Expedite::Server::ApplicationManager
- Inherits:
-
Object
- Object
- Expedite::Server::ApplicationManager
- Defined in:
- lib/expedite/server/application_manager.rb
Instance Attribute Summary collapse
-
#pools ⇒ Object
readonly
Returns the value of attribute pools.
Instance Method Summary collapse
-
#initialize(env) ⇒ ApplicationManager
constructor
A new instance of ApplicationManager.
- #with(name) ⇒ Object
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
#pools ⇒ Object (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 |