class InfluxDB::MaxQueue

Queue with max length limit

Attributes

max[R]

Public Class Methods

new(max = 10_000) click to toggle source
Calls superclass method
# File lib/influxdb/max_queue.rb, line 6
def initialize(max = 10_000)
  raise ArgumentError, "queue size must be positive" if max <= 0

  @max = max
  super()
end

Public Instance Methods

push(obj) click to toggle source
Calls superclass method
# File lib/influxdb/max_queue.rb, line 13
def push(obj)
  super if length < @max
end