Class: Honeybadger::Worker::Queue Private

Inherits:
Queue
  • Object
show all
Defined in:
lib/honeybadger/worker.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A queue which enforces a maximum size.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_size) ⇒ Queue

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Queue


21
22
23
24
# File 'lib/honeybadger/worker.rb', line 21

def initialize(max_size)
  @max_size = max_size
  super()
end

Instance Attribute Details

#max_sizeObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


19
20
21
# File 'lib/honeybadger/worker.rb', line 19

def max_size
  @max_size
end

Instance Method Details

#push(msg) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


26
27
28
# File 'lib/honeybadger/worker.rb', line 26

def push(msg)
  super unless size == max_size
end