Class: ResourcePool
- Inherits:
-
Object
show all
- Defined in:
- lib/q/resource_pool.rb
Defined Under Namespace
Classes: ResourcePoolTimeoutError
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ResourcePool.
6
7
8
9
|
# File 'lib/q/resource_pool.rb', line 6
def initialize config
extend MonitorMixin
@config = config
end
|
Instance Method Details
#config ⇒ Object
21
22
23
|
# File 'lib/q/resource_pool.rb', line 21
def config
@config ||= {}
end
|
#create_resource ⇒ Object
17
18
19
|
# File 'lib/q/resource_pool.rb', line 17
def create_resource
raise NotImplementedError
end
|
#with_resource ⇒ Object
11
12
13
14
15
|
# File 'lib/q/resource_pool.rb', line 11
def with_resource
result = yield resource
checkin
result
end
|