class Handlers::SRCommonHandler

Common events handler for sender and receiver client

Attributes

auto_settle_off[RW]

Auto settle off

idle_timeout[RW]

Idle timeout

log_lib[RW]

Client library logging

log_msgs[RW]

Format of log

max_frame_size[RW]

Max frame size

msg_content_hashed[RW]

Content hashed

sasl_enabled[RW]

SASL enabled

Public Class Methods

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

Initialization of common events handler for sender and receiver client

Common events handler arguments

broker

URI of broker

log_msgs

format of message(s) log

sasl_mechs

allowed SASL mechanisms

Calls superclass method Handlers::BasicHandler::new
# File lib/handlers/sr_common_handler.rb, line 48
def initialize(
  broker,
  log_msgs,
  msg_content_hashed,
  sasl_mechs,
  idle_timeout,
  max_frame_size,
  sasl_enabled,
  log_lib,
  auto_settle_off,
  exit_timer
)
  super(
    broker,
    sasl_mechs,
    idle_timeout,
    max_frame_size,
    sasl_enabled,
    log_lib,
    exit_timer
  )
  # Save message(s) log format
  @log_msgs = log_msgs
  # Save message(s) content hashed
  @msg_content_hashed = msg_content_hashed
  # Save auto settle off
  @auto_settle_off = auto_settle_off
end

Public Instance Methods

on_error(condition) click to toggle source

Default for un-handled errors is to raise an exception

# File lib/handlers/sr_common_handler.rb, line 92
def on_error(condition)
  raise condition
end
print_message(msg) click to toggle source

Print of sent/received message

Arguments

msg

message to print