promiscuous 0.10.1 → 0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/promiscuous.rb +1 -0
- data/lib/promiscuous/ephemeral.rb +13 -0
- data/lib/promiscuous/publisher.rb +1 -0
- data/lib/promiscuous/publisher/ephemeral.rb +9 -0
- data/lib/promiscuous/publisher/worker.rb +1 -1
- data/lib/promiscuous/subscriber/worker.rb +1 -0
- data/lib/promiscuous/version.rb +1 -1
- metadata +5 -3
data/lib/promiscuous.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
class Promiscuous::Ephemeral
|
2
|
+
def initialize(attributes)
|
3
|
+
attributes.each { |k, v| self.__send__("#{k}=", v) }
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.create(attributes)
|
7
|
+
new(attributes).tap { |m| m.save }
|
8
|
+
end
|
9
|
+
|
10
|
+
def save
|
11
|
+
self.class.promiscuous_publisher.new(:instance => self).publish
|
12
|
+
end
|
13
|
+
end
|
@@ -12,6 +12,7 @@ module Promiscuous::Publisher
|
|
12
12
|
autoload :Polymorphic, 'promiscuous/publisher/polymorphic'
|
13
13
|
autoload :Worker, 'promiscuous/publisher/worker'
|
14
14
|
autoload :Error, 'promiscuous/publisher/error'
|
15
|
+
autoload :Ephemeral, 'promiscuous/publisher/ephemeral'
|
15
16
|
|
16
17
|
def self.lint(*args)
|
17
18
|
Lint.lint(*args)
|
@@ -34,7 +34,7 @@ class Promiscuous::Publisher::Worker
|
|
34
34
|
unless e.is_a?(Promiscuous::Publisher::Error)
|
35
35
|
e = Promiscuous::Publisher::Error.new(e, nil)
|
36
36
|
end
|
37
|
-
Promiscuous.error "[publish] FATAL #{e}"
|
37
|
+
Promiscuous.error "[publish] FATAL #{e} #{e.backtrace}"
|
38
38
|
Promiscuous::Config.error_handler.try(:call, e)
|
39
39
|
end
|
40
40
|
end
|
@@ -17,6 +17,7 @@ class Promiscuous::Subscriber::Worker
|
|
17
17
|
# TODO Discuss with Arjun about having an error queue.
|
18
18
|
self.stop = true
|
19
19
|
Promiscuous::AMQP.disconnect
|
20
|
+
Promiscuous.error "[receive] FATAL #{e} #{e.backtrace.join("\n")}"
|
20
21
|
Promiscuous.error "[receive] FATAL #{e}"
|
21
22
|
Promiscuous::Config.error_handler.try(:call, e)
|
22
23
|
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.11'
|
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-10-
|
13
|
+
date: 2012-10-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- lib/promiscuous/publisher/model.rb
|
124
124
|
- lib/promiscuous/publisher/mongoid.rb
|
125
125
|
- lib/promiscuous/publisher/worker.rb
|
126
|
+
- lib/promiscuous/publisher/ephemeral.rb
|
126
127
|
- lib/promiscuous/railtie/replicate.rake
|
127
128
|
- lib/promiscuous/subscriber/envelope.rb
|
128
129
|
- lib/promiscuous/subscriber/error.rb
|
@@ -155,9 +156,10 @@ files:
|
|
155
156
|
- lib/promiscuous/railtie.rb
|
156
157
|
- lib/promiscuous/observer.rb
|
157
158
|
- lib/promiscuous/common.rb
|
158
|
-
- lib/promiscuous/publisher.rb
|
159
159
|
- lib/promiscuous/subscriber.rb
|
160
160
|
- lib/promiscuous/worker.rb
|
161
|
+
- lib/promiscuous/publisher.rb
|
162
|
+
- lib/promiscuous/ephemeral.rb
|
161
163
|
- lib/promiscuous/version.rb
|
162
164
|
- lib/promiscuous.rb
|
163
165
|
- README.md
|