Exception: KubeMQ::BufferFullError

Inherits:
Error
  • Object
show all
Defined in:
lib/kubemq/errors.rb

Overview

Raised when the reconnect message buffer reaches capacity.

During disconnection, outbound messages are buffered. When the buffer is full, the oldest message is dropped. Not retryable — wait for the connection to recover or increase the buffer size.

Instance Attribute Summary collapse

Attributes inherited from Error

#channel, #code, #details, #operation, #request_id, #suggestion

Instance Method Summary collapse

Methods inherited from Error

#cause, #retryable?, #to_s

Constructor Details

#initialize(message, buffer_size: 0, **kwargs) ⇒ BufferFullError

Returns a new instance of BufferFullError.

Parameters:

  • message (String)

    error description

  • buffer_size (Integer) (defaults to: 0)

    buffer size at time of overflow (default: 0)

  • kwargs (Hash)

    additional options forwarded to Error#initialize



256
257
258
259
260
261
# File 'lib/kubemq/errors.rb', line 256

def initialize(message, buffer_size: 0, **kwargs)
  kwargs[:code] = ErrorCode::BUFFER_FULL
  kwargs[:retryable] = false unless kwargs.key?(:retryable)
  super(message, **kwargs)
  @buffer_size = buffer_size
end

Instance Attribute Details

#buffer_sizeInteger (readonly)

Returns current buffer size when the error occurred.

Returns:

  • (Integer)

    current buffer size when the error occurred



251
252
253
# File 'lib/kubemq/errors.rb', line 251

def buffer_size
  @buffer_size
end