Module: FTW::Poolable
- Included in:
- Connection
- Defined in:
- lib/ftw/poolable.rb
Overview
A poolable mixin. This is for use with the FTW::Pool class.
Instance Method Summary collapse
-
#available? ⇒ Boolean
Is this resource available for use?.
-
#mark ⇒ Object
Mark that this resource is in use.
-
#release ⇒ Object
Release this resource.
Instance Method Details
#available? ⇒ Boolean
Is this resource available for use?
16 17 18 |
# File 'lib/ftw/poolable.rb', line 16 def available? return !@__in_use end |
#mark ⇒ Object
Mark that this resource is in use
6 7 8 |
# File 'lib/ftw/poolable.rb', line 6 def mark @__in_use = true end |
#release ⇒ Object
Release this resource
11 12 13 |
# File 'lib/ftw/poolable.rb', line 11 def release @__in_use = false end |