Module: Beetle

Defined in:
lib/beetle.rb,
lib/beetle/r_c.rb,
lib/beetle/base.rb,
lib/beetle/client.rb,
lib/beetle/handler.rb,
lib/beetle/logging.rb,
lib/beetle/message.rb,
lib/beetle/version.rb,
lib/beetle/publisher.rb,
lib/beetle/subscriber.rb,
lib/beetle/configuration.rb,
lib/beetle/queue_properties.rb,
lib/beetle/deduplication_store.rb

Defined Under Namespace

Modules: Logging, RC Classes: Base, Client, Configuration, ConfigurationError, DeduplicationStore, Error, Handler, Message, NoMessageSent, NoRedisMaster, Publisher, QueueProperties, Subscriber, UnknownMessage, UnknownQueue

Constant Summary collapse

Timer =
Timeout
EXCHANGE_CREATION_KEYS =

AMQP options for exchange creation

[:auto_delete, :durable, :internal, :nowait, :passive]
QUEUE_CREATION_KEYS =

AMQP options for queue creation

[:passive, :durable, :exclusive, :auto_delete, :no_wait, :arguments]
QUEUE_BINDING_KEYS =

AMQP options for queue bindings

[:key, :no_wait]
PUBLISHING_KEYS =

AMQP options for message publishing

[:key, :mandatory, :immediate, :persistent, :reply_to, :headers, :priority]
SUBSCRIPTION_KEYS =

AMQP options for subscribing to queues

[:ack, :key]
VERSION =
"3.5.7"

Class Method Summary collapse

Class Method Details

.configObject

returns the default configuration object and yields it if a block is given



61
62
63
64
65
# File 'lib/beetle.rb', line 61

def self.config
  #:yields: config
  @config ||= Configuration.new
  block_given? ? yield(@config) : @config
end

.hostnameObject

determine the fully qualified domainname of the host we’re running on



46
47
48
49
50
# File 'lib/beetle.rb', line 46

def self.hostname
  name = Socket.gethostname
  host = name.split('.').first
  Addrinfo.getaddrinfo(host, nil, nil, :STREAM, nil, Socket::AI_CANONNAME).first.canonname rescue name
end

.reraise_expectation_errors!Object

:nocov:



69
70
71
# File 'lib/beetle.rb', line 69

def self.reraise_expectation_errors! #:nodoc:
  raise if $!.is_a?(Mocha::ExpectationError)
end