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 8 def initialize(max = 10_000) fail ArgumentError, "queue size must be positive" unless 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 14 def push(obj) super if length < @max end