promiscuous 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ module Promiscuous::Common::Worker
6
6
  self.stop = false
7
7
  end
8
8
 
9
- def unit_of_work
9
+ def unit_of_work(type)
10
10
  if defined?(Mongoid)
11
11
  Mongoid.unit_of_work { yield }
12
12
  else
@@ -24,7 +24,7 @@ class Promiscuous::Publisher::Worker
24
24
  def replicate_once
25
25
  return if self.stop
26
26
  begin
27
- self.unit_of_work do
27
+ self.unit_of_work('publisher') do
28
28
  Promiscuous::Publisher::Mongoid::Defer.klasses.values.each do |klass|
29
29
  replicate_collection(klass)
30
30
  end
@@ -9,7 +9,9 @@ class Promiscuous::Subscriber::Worker
9
9
  begin
10
10
  unless self.stop
11
11
  Promiscuous.info "[receive] #{payload}"
12
- self.unit_of_work { Promiscuous::Subscriber.process(JSON.parse(payload)) }
12
+ parsed_payload = JSON.parse(payload)
13
+ queue = parsed_payload['__amqp__']
14
+ self.unit_of_work(queue) { Promiscuous::Subscriber.process(parsed_payload) }
13
15
  metadata.ack
14
16
  end
15
17
  rescue Exception => e
@@ -1,3 +1,3 @@
1
1
  module Promiscuous
2
- VERSION = '0.16.0'
2
+ VERSION = '0.17.0'
3
3
  end
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.16.0
4
+ version: 0.17.0
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: 2012-12-05 00:00:00.000000000 Z
13
+ date: 2012-12-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -122,8 +122,8 @@ files:
122
122
  - lib/promiscuous/common/lint.rb
123
123
  - lib/promiscuous/common/lint/base.rb
124
124
  - lib/promiscuous/common/class_helpers.rb
125
- - lib/promiscuous/common/worker.rb
126
125
  - lib/promiscuous/common/options.rb
126
+ - lib/promiscuous/common/worker.rb
127
127
  - lib/promiscuous/loader.rb
128
128
  - lib/promiscuous/publisher/envelope.rb
129
129
  - lib/promiscuous/publisher/lint.rb