Class: Vault::PersistentHTTP::TimedStackMulti

Inherits:
ConnectionPool::TimedStack show all
Defined in:
lib/vault/persistent/timed_stack_multi.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from ConnectionPool::TimedStack

#pop, #push, #shutdown

Constructor Details

#initialize(size = 0, &block) ⇒ TimedStackMulti

Returns a new instance of TimedStackMulti.



4
5
6
7
8
9
10
11
# File 'lib/vault/persistent/timed_stack_multi.rb', line 4

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

Returns:

  • (Boolean)


13
14
15
# File 'lib/vault/persistent/timed_stack_multi.rb', line 13

def empty?
  (@created - @enqueued) >= @max
end

#lengthObject



17
18
19
# File 'lib/vault/persistent/timed_stack_multi.rb', line 17

def length
  @max - @created + @enqueued
end