Class: FiberRecycling::RecycledFiberPool
- Inherits:
-
QuackPool
- Object
- QuackPool
- FiberRecycling::RecycledFiberPool
- Defined in:
- lib/fiber_recycling/recycled_fiber_pool.rb
Class Method Summary collapse
Instance Method Summary collapse
- #absorb_recycled_fiber(recycled_fiber) ⇒ Object
- #borrower ⇒ Object
-
#initialize ⇒ RecycledFiberPool
constructor
A new instance of RecycledFiberPool.
- #release_recycled_fiber ⇒ Object
Constructor Details
#initialize ⇒ RecycledFiberPool
Returns a new instance of RecycledFiberPool.
11 12 13 |
# File 'lib/fiber_recycling/recycled_fiber_pool.rb', line 11 def initialize super(resource_class: RecycledFiber) end |
Class Method Details
.local ⇒ Object
4 5 6 7 8 9 |
# File 'lib/fiber_recycling/recycled_fiber_pool.rb', line 4 def self.local unless Thread.current.thread_variable_get(:fiber_recycling__recycled_fiber_pool) Thread.current.thread_variable_set(:fiber_recycling__recycled_fiber_pool, new) end Thread.current.thread_variable_get(:fiber_recycling__recycled_fiber_pool) end |
Instance Method Details
#absorb_recycled_fiber(recycled_fiber) ⇒ Object
15 16 17 |
# File 'lib/fiber_recycling/recycled_fiber_pool.rb', line 15 def absorb_recycled_fiber(recycled_fiber) absorb_resource(recycled_fiber) end |
#borrower ⇒ Object
19 20 21 |
# File 'lib/fiber_recycling/recycled_fiber_pool.rb', line 19 def borrower RecycledFiberPoolBorrower.new(self) end |
#release_recycled_fiber ⇒ Object
23 24 25 |
# File 'lib/fiber_recycling/recycled_fiber_pool.rb', line 23 def release_recycled_fiber release_resource end |