promiscuous 0.24 → 0.25
Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ module Promiscuous::AMQP:: Bunny
|
|
3
3
|
|
4
4
|
def self.connect
|
5
5
|
require 'bunny'
|
6
|
-
self.connection = ::Bunny.new(Promiscuous::Config.server_uri)
|
6
|
+
self.connection = ::Bunny.new(Promiscuous::Config.server_uri, { :heartbeat => Promiscuous::Config.heartbeat })
|
7
7
|
self.connection.start
|
8
8
|
end
|
9
9
|
|
@@ -9,12 +9,13 @@ module Promiscuous::AMQP::RubyAMQP
|
|
9
9
|
raise "Please use amqp://user:password@host:port/vhost" if uri.scheme != 'amqp'
|
10
10
|
|
11
11
|
{
|
12
|
-
:host
|
13
|
-
:port
|
14
|
-
:scheme
|
15
|
-
:user
|
16
|
-
:pass
|
17
|
-
:vhost
|
12
|
+
:host => uri.host,
|
13
|
+
:port => uri.port,
|
14
|
+
:scheme => uri.scheme,
|
15
|
+
:user => uri.user,
|
16
|
+
:pass => uri.password,
|
17
|
+
:vhost => uri.path.empty? ? "/" : uri.path,
|
18
|
+
:heartbeat => Promiscuous::Config.heartbeat
|
18
19
|
}
|
19
20
|
end
|
20
21
|
|
data/lib/promiscuous/config.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Promiscuous::Config
|
2
|
-
mattr_accessor :app, :logger, :error_notifier, :backend, :server_uri, :queue_options
|
2
|
+
mattr_accessor :app, :logger, :error_notifier, :backend, :server_uri, :queue_options, :heartbeat
|
3
3
|
|
4
4
|
def self.backend=(value)
|
5
5
|
@@backend = "Promiscuous::AMQP::#{value.to_s.camelize.gsub(/amqp/, 'AMQP')}".constantize unless value.nil?
|
@@ -13,6 +13,7 @@ module Promiscuous::Config
|
|
13
13
|
self.backend ||= defined?(EventMachine) && EventMachine.reactor_running? ? :rubyamqp : :bunny
|
14
14
|
self.logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDERR).tap { |l| l.level = Logger::WARN }
|
15
15
|
self.queue_options ||= {:durable => true, :arguments => {'x-ha-policy' => 'all'}}
|
16
|
+
self.heartbeat ||= 60
|
16
17
|
|
17
18
|
Promiscuous::AMQP.connect
|
18
19
|
end
|
data/lib/promiscuous/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: promiscuous
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.25'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-01-
|
13
|
+
date: 2013-01-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -118,8 +118,8 @@ extensions: []
|
|
118
118
|
extra_rdoc_files: []
|
119
119
|
files:
|
120
120
|
- lib/promiscuous/amqp/null.rb
|
121
|
-
- lib/promiscuous/amqp/ruby_amqp.rb
|
122
121
|
- lib/promiscuous/amqp/bunny.rb
|
122
|
+
- lib/promiscuous/amqp/ruby_amqp.rb
|
123
123
|
- lib/promiscuous/common/lint/base.rb
|
124
124
|
- lib/promiscuous/common/class_helpers.rb
|
125
125
|
- lib/promiscuous/common/options.rb
|