rabid_mq 0.1.34 → 0.1.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rabid_mq/publisher.rb +14 -16
- data/lib/rabid_mq/version.rb +1 -1
- data/lib/rabid_mq.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd62092327b8c0d5914d4364b48564eb16c9aba0
|
4
|
+
data.tar.gz: c468666cc6283c529c5ffdd94ce8df8034e83ecd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 347116d5de2b0c93543cb52c882ca242a2c6ea534a91e75548c8a2a3dbc56e70936fada7f1369711c2f4f3657611aa34100fb81250b64d3be8b4ff1339093a53
|
7
|
+
data.tar.gz: 87d949b44cdc05cfcd8d52a8d85881e4d20321d106bb865f106cee655bc39918b28dc7cb301de1b41fd34572e21a0bbe9c37563cfc16e7e830640b8e89348097
|
data/lib/rabid_mq/publisher.rb
CHANGED
@@ -49,29 +49,27 @@ module RabidMQ
|
|
49
49
|
|
50
50
|
# Get a channel with the Bunny::Session
|
51
51
|
delegate :channel,
|
52
|
-
:reconnect,
|
53
|
-
:connection,
|
54
52
|
:name_with_env,
|
55
53
|
:topic_exchange,
|
56
54
|
to: ::RabidMQ
|
57
55
|
|
58
56
|
# # Start a new connection
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
57
|
+
def amqp_connect
|
58
|
+
amqp_connection.tap do |c|
|
59
|
+
c.start
|
60
|
+
end
|
61
|
+
end
|
64
62
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
63
|
+
def name_with_env(name)
|
64
|
+
return name unless defined?(::Rails)
|
65
|
+
return name if name.match /\[(development|test|production|integration|pod)\]/
|
66
|
+
name + "[#{Config.environment}]"
|
67
|
+
end
|
70
68
|
|
71
|
-
#
|
72
|
-
|
73
|
-
|
74
|
-
|
69
|
+
# Provide a new or existing Bunny::Session
|
70
|
+
def amqp_connection
|
71
|
+
@amqp_connection ||= Bunny.new RabidMQ::Config.load_config
|
72
|
+
end
|
75
73
|
|
76
74
|
end
|
77
75
|
end
|
data/lib/rabid_mq/version.rb
CHANGED
data/lib/rabid_mq.rb
CHANGED