Class: Griffin::ConnectionPool::MultiTimedStack
- Inherits:
-
ConnectionPool::TimedStack
- Object
- ConnectionPool::TimedStack
- Griffin::ConnectionPool::MultiTimedStack
- Defined in:
- lib/griffin/connection_pool/multi_timed_stack.rb
Overview
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(size = 0, &block) ⇒ MultiTimedStack
constructor
A new instance of MultiTimedStack.
- #length ⇒ Object
Constructor Details
#initialize(size = 0, &block) ⇒ MultiTimedStack
Returns a new instance of MultiTimedStack.
9 10 11 12 13 14 15 |
# File 'lib/griffin/connection_pool/multi_timed_stack.rb', line 9 def initialize(size = 0, &block) super @enqueued = 0 @ques = Hash.new { |h, k| h[k] = [] } @lru = [] end |
Instance Method Details
#empty? ⇒ Boolean
17 18 19 |
# File 'lib/griffin/connection_pool/multi_timed_stack.rb', line 17 def empty? length <= 0 end |
#length ⇒ Object
21 22 23 |
# File 'lib/griffin/connection_pool/multi_timed_stack.rb', line 21 def length @max - @created + @enqueued end |