Class: Vault::PersistentHTTP::TimedStackMulti
- Inherits:
-
ConnectionPool::TimedStack
- Object
- ConnectionPool::TimedStack
- Vault::PersistentHTTP::TimedStackMulti
- Defined in:
- lib/vault/persistent/timed_stack_multi.rb
Overview
:nodoc:
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(size = 0, &block) ⇒ TimedStackMulti
constructor
A new instance of TimedStackMulti.
- #length ⇒ Object
Methods inherited from ConnectionPool::TimedStack
Constructor Details
#initialize(size = 0, &block) ⇒ TimedStackMulti
Returns a new instance of TimedStackMulti.
7 8 9 10 11 12 13 14 |
# File 'lib/vault/persistent/timed_stack_multi.rb', line 7 def initialize(size = 0, &block) super @enqueued = 0 @ques = Hash.new { |h, k| h[k] = [] } @lru = {} @key = :"connection_args-#{object_id}" end |
Instance Method Details
#empty? ⇒ Boolean
16 17 18 |
# File 'lib/vault/persistent/timed_stack_multi.rb', line 16 def empty? (@created - @enqueued) >= @max end |
#length ⇒ Object
20 21 22 |
# File 'lib/vault/persistent/timed_stack_multi.rb', line 20 def length @max - @created + @enqueued end |