Sha256: 6c4a47a882cfa25ff936730d5dadb451e8f4031835761a599630229baba6acf1

Contents?: true

Size: 248 Bytes

Versions: 4

Compression:

Stored size: 248 Bytes

Contents

module Errplane
  class MaxQueue < Queue
    attr_accessor :max_depth

    def initialize(max_depth = 10_000)
      @max_depth = max_depth
      super()
    end

    def push_or_discard(data)
      push(data) if size < @max_depth
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
errplane-0.5.10 lib/errplane/max_queue.rb
errplane-0.5.9 lib/errplane/max_queue.rb
errplane-0.5.8 lib/errplane/max_queue.rb
errplane-0.5.7 lib/errplane/max_queue.rb