mafia_amqp 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05ebe33c6ea5bd5237fd52d94b1f7df3704d5136
4
- data.tar.gz: 211ba3f7435bc30d1015e594b7ab3406013a8c90
3
+ metadata.gz: bbc89fd3d263db62a1e8ebf6aa79d834e7e14dab
4
+ data.tar.gz: 7399e2e1939551250a57afd79f329f49da8991f8
5
5
  SHA512:
6
- metadata.gz: 0a4f7ffba83604ab9f3bc6ab1703c39a1a9d10a1b8daf2f7877f3e2568ce4689326c2df121f6dd2a41f9652e270ed36eb63fb746d1b0f03e87fb6f0bc1af1e02
7
- data.tar.gz: c05b95d890524b09bb8bcc5d58fa602d5687e64cc4b759f671660490655ca67352ed474d9fcddc68cc2822a36681c80893b245a49d0d1520e73d589a2f49d537
6
+ metadata.gz: 38f7044f760e1e4cc606d00d7a925c9fef59338a75622e29ffd8c0ef74a434efa415c88942c51446e8255001626782b13b6ec699f7e44d1fe8cee4512dcbe0b1
7
+ data.tar.gz: 6113116ed5b2cfc5623400002d6bf498dc2ac334bc4e53385d30b17ffd814cb591035b0501eede77a6f88379fc8b753e67293f66dc7ae22efc963d922942e1ea
data/lib/mafia.rb CHANGED
@@ -34,4 +34,13 @@ module Mafia
34
34
  def self.log_level
35
35
  @config[:log_level] || ::Logger::INFO
36
36
  end
37
+
38
+ def self.config_to_url(config)
39
+ user = config[:username]
40
+ password = config[:password]
41
+ host = config[:host]
42
+ port = config[:port]
43
+ vhost = config[:vhost]
44
+ "amqp://#{user}:#{password}@#{host}:#{port}#{vhost}"
45
+ end
37
46
  end
@@ -3,9 +3,13 @@ module Mafia
3
3
  def initialize(config=nil)
4
4
  @config = config || Mafia.config
5
5
 
6
+ Mafia.logger.info("Mafia consumer pool starting connection to #{Mafia.config_to_url(@config)}")
7
+
6
8
  @conn = Bunny.new(@config.slice(:host, :port, :username, :password, :vhost))
7
9
  @conn.start
8
10
 
11
+ Mafia.logger.info("Mafia consumer pool started, waiting for rpc events")
12
+
9
13
  # create a channel and exchange that both client and server know about
10
14
  @channel = @conn.create_channel
11
15
  @queue = @channel.queue(@config[:queue])
data/lib/mafia/dealer.rb CHANGED
@@ -3,9 +3,12 @@ module Mafia
3
3
  def initialize(config=nil)
4
4
  @config = config || Mafia.config
5
5
 
6
+ Mafia.logger.info("Mafia dealer starting connection to #{Mafia.config_to_url(@config)}")
6
7
  @conn = Bunny.new(@config.slice(:host, :port, :username, :password, :vhost))
7
8
  @conn.start
8
9
 
10
+ Mafia.logger.info("Mafia dealer connection started")
11
+
9
12
  # create a channel and exchange that both client and server know about
10
13
  @channel = @conn.create_channel
11
14
  @queue = @channel.queue(@config[:queue])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mafia_amqp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Teodor Pripoae