Class: Net::HTTP::Persistent::TimedStackMulti

Inherits:
ConnectionPool::TimedStack
  • Object
show all
Defined in:
lib/net/http/persistent/timed_stack_multi.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TimedStackMulti.



3
4
5
6
7
8
9
10
# File 'lib/net/http/persistent/timed_stack_multi.rb', line 3

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)


12
13
14
# File 'lib/net/http/persistent/timed_stack_multi.rb', line 12

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

#lengthObject



16
17
18
# File 'lib/net/http/persistent/timed_stack_multi.rb', line 16

def length
  @max - @created + @enqueued
end