class Handlers::BasicHandler

Basic events handler for all clients

Attributes

broker[RW]

URI of broker

exit_timer[RW]

Exit timer limits the run-time of the application

idle_timeout[RW]

Idle timeout

log_lib[RW]

Client library logging

max_frame_size[RW]

Max frame size

sasl_enabled[RW]

SASL enabled

sasl_mechs[RW]

Allowed SASL mechs

Public Class Methods

new( broker, sasl_mechs, idle_timeout, max_frame_size, sasl_enabled, log_lib, exit_timer ) click to toggle source

Initialization of basic events handler for all clients

Basic events handler arguments

broker

URI of broker

sasl_mechs: allowed SASL mechanisms

Calls superclass method
# File lib/handlers/basic_handler.rb, line 44
def initialize(
  broker,
  sasl_mechs,
  idle_timeout,
  max_frame_size,
  sasl_enabled,
  log_lib,
  exit_timer
)
  super()
  @exit_timer = exit_timer
  # Save URI of broker
  if broker.is_a? URI::AMQP or broker.is_a? URI::AMQPS
    @broker = broker
  else
    @broker = Qpid::Proton.uri(broker)
  end
  # Save allowed SASL mechanisms
  @sasl_mechs = sasl_mechs
  # Save idle timeout
  @idle_timeout = idle_timeout
  # Save max frame size
  @max_frame_size = max_frame_size
  # Save SASL enabled
  @sasl_enabled = sasl_enabled
  # Save client library logging
  @log_lib = log_lib
  # Set environment variable for client library logging
  EnvUtils.set_log_lib_env(@log_lib)
end