Sha256: a06183e273aad3fb443aee3ba186ca2b8fd12d68e6f712a040abc425783320af
Contents?: true
Size: 1.01 KB
Versions: 1
Compression:
Stored size: 1.01 KB
Contents
module AMQP VERSION = '0.5.9' DIR = File.expand_path(File.dirname(File.expand_path(__FILE__))) $:.unshift DIR require 'ext/em' require 'ext/blankslate' %w[ buffer spec protocol frame client ].each do |file| require "amqp/#{file}" end class << self @logging = false attr_accessor :logging attr_reader :conn alias :connection :conn end def self.connect *args Client.connect *args end def self.settings @settings ||= { # server address :host => '127.0.0.1', :port => PORT, # login details :user => 'guest', :pass => 'guest', :vhost => '/', # connection timeout :timeout => nil, # logging :logging => false } end def self.start *args @conn ||= connect *args end def self.stop if @conn @conn.close{ yield if block_given? @conn = nil } end end def self.run *args EM.run{ AMQP.start(*args).callback{ yield } } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
amqp-0.5.9 | lib/amqp.rb |