module Hutch

Constants

Adapter
VERSION

Public Class Methods

broker() click to toggle source
# File lib/hutch.rb, line 57
def self.broker
  @broker
end
connect(options = {}, config = Hutch::Config) click to toggle source

Connects to broker, if not yet connected.

@param options [Hash] Connection options @param config [Hash] Configuration @option options [Boolean] :enable_http_api_use

# File lib/hutch.rb, line 44
def self.connect(options = {}, config = Hutch::Config)
  @@connection_mutex.synchronize do
    unless connected?
      @broker = Hutch::Broker.new(config)
      @broker.connect(options)
    end
  end
end
connected?() click to toggle source

@return [Boolean]

# File lib/hutch.rb, line 62
def self.connected?
  broker && broker.connection && broker.connection.open?
end
consumers() click to toggle source
# File lib/hutch.rb, line 23
def self.consumers
  @consumers ||= []
end
disconnect() click to toggle source
# File lib/hutch.rb, line 53
def self.disconnect
  @broker.disconnect if @broker
end
global_properties() click to toggle source
# File lib/hutch.rb, line 35
def self.global_properties
  @global_properties ||= {}
end
global_properties=(properties) click to toggle source
# File lib/hutch.rb, line 31
def self.global_properties=(properties)
  @global_properties = properties
end
logger() click to toggle source
# File lib/hutch.rb, line 27
def self.logger
  Hutch::Logging.logger
end
publish(*args) click to toggle source
# File lib/hutch.rb, line 66
def self.publish(*args)
  broker.publish(*args)
end
register_consumer(consumer) click to toggle source
# File lib/hutch.rb, line 19
def self.register_consumer(consumer)
  self.consumers << consumer
end