promiscuous 0.100.3 → 0.100.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/promiscuous/cli.rb +4 -4
- data/lib/promiscuous/config.rb +1 -2
- data/lib/promiscuous/publisher/operation/base.rb +0 -1
- data/lib/promiscuous/railtie.rb +14 -0
- data/lib/promiscuous/version.rb +1 -1
- metadata +32 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89d7c447d208a6d48491d22a33d531315dd7d228
|
4
|
+
data.tar.gz: 686c4e37973213dbcb9c0c2a1e6a92da22c25006
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51f5b3a0966b1e020b831c3824cd5694a40df408456d29b98d30c72ec3f6a7a92dbe9f639d8aae29e92b8c694f8fd894cf9edf6418ee110875a3cd655ce933be
|
7
|
+
data.tar.gz: f447a3f6c3374dd072ddaae10cd529940f3bc1a85ee696f66f3f342710f152ee11d24e9ef0770c0629cae252c31fa9f7a066c37481782f30f1968d8f24602417
|
data/lib/promiscuous/cli.rb
CHANGED
@@ -133,10 +133,6 @@ class Promiscuous::CLI
|
|
133
133
|
opts.separator ""
|
134
134
|
opts.separator "Options:"
|
135
135
|
|
136
|
-
opts.on "-d", "--no-deps", "Skip dependency tracking (subscribe only option)" do
|
137
|
-
Promiscuous::Config.no_deps = true
|
138
|
-
end
|
139
|
-
|
140
136
|
opts.on "-l", "--require FILE", "File to require to load your app. Don't worry about it with rails" do |file|
|
141
137
|
options[:require] = file
|
142
138
|
end
|
@@ -154,6 +150,10 @@ class Promiscuous::CLI
|
|
154
150
|
Promiscuous::Config.stats_interval = duration.to_f
|
155
151
|
end
|
156
152
|
|
153
|
+
opts.on "-t", "--threads [NUM]", "Number of subscriber worker threads to run. Defaults to 10." do |threads|
|
154
|
+
Promiscuous::Config.subscriber_threads = threads.to_i
|
155
|
+
end
|
156
|
+
|
157
157
|
opts.on "-D", "--daemonize", "Daemonize process" do
|
158
158
|
options[:daemonize] = true
|
159
159
|
end
|
data/lib/promiscuous/config.rb
CHANGED
@@ -3,7 +3,7 @@ module Promiscuous::Config
|
|
3
3
|
:publisher_amqp_url, :subscriber_amqp_url, :publisher_exchange,
|
4
4
|
:subscriber_exchanges, :queue_name, :queue_options, :redis_url,
|
5
5
|
:redis_urls, :redis_stats_url, :stats_interval,
|
6
|
-
:socket_timeout, :heartbeat, :
|
6
|
+
:socket_timeout, :heartbeat, :hash_size,
|
7
7
|
:prefetch, :recovery_timeout, :logger, :subscriber_threads,
|
8
8
|
:version_field, :error_notifier, :recovery_on_boot,
|
9
9
|
:on_stats, :max_retries, :generation, :destroy_timeout, :destroy_check_interval
|
@@ -50,7 +50,6 @@ module Promiscuous::Config
|
|
50
50
|
self.stats_interval ||= 0
|
51
51
|
self.socket_timeout ||= 10
|
52
52
|
self.heartbeat ||= 60
|
53
|
-
self.no_deps ||= false
|
54
53
|
self.hash_size ||= 2**20 # one million keys ~ 200Mb.
|
55
54
|
self.prefetch ||= 1000
|
56
55
|
self.recovery_timeout ||= 10
|
@@ -138,7 +138,6 @@ class Promiscuous::Publisher::Operation::Base
|
|
138
138
|
payload[:current_user_id] = Promiscuous.context.current_user.id if Promiscuous.context.current_user
|
139
139
|
payload[:timestamp] = @timestamp
|
140
140
|
payload[:generation] = Promiscuous::Config.generation
|
141
|
-
payload[:context] = "DEPRECATED"
|
142
141
|
payload[:host] = Socket.gethostname
|
143
142
|
payload[:recovered_operation] = true if recovering?
|
144
143
|
payload[:dependencies] = {}
|
data/lib/promiscuous/railtie.rb
CHANGED
@@ -1,5 +1,19 @@
|
|
1
|
+
module Promiscuous::ControllerMiddleware
|
2
|
+
extend ActiveSupport::Concern
|
3
|
+
|
4
|
+
def process_action(*args)
|
5
|
+
Promiscuous::Publisher::Context::Base.current.current_user = self.current_user if self.respond_to?(:current_user)
|
6
|
+
super
|
7
|
+
Promiscuous::Publisher::Context::Base.current.current_user = nil
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
1
11
|
class Promiscuous::Railtie < Rails::Railtie
|
2
12
|
initializer 'load promiscuous' do
|
13
|
+
ActiveSupport.on_load(:action_controller) do
|
14
|
+
include Promiscuous::ControllerMiddleware
|
15
|
+
end
|
16
|
+
|
3
17
|
config.after_initialize do
|
4
18
|
Promiscuous::Config.configure unless Promiscuous::Config.configured?
|
5
19
|
Promiscuous::Loader.prepare
|
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.100.
|
4
|
+
version: 0.100.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Viennot
|
@@ -9,104 +9,104 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '3'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '3'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: activemodel
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '3'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '3'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: bunny
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: 0.10.7
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: 0.10.7
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: amq-protocol
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: 1.8.0
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: 1.8.0
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: ruby-progressbar
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - ~>
|
74
|
+
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: 1.2.0
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - ~>
|
81
|
+
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: 1.2.0
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: redis
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- - ~>
|
88
|
+
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: 3.0.2
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- - ~>
|
95
|
+
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: 3.0.2
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: algorithms
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- - ~>
|
102
|
+
- - "~>"
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: 0.6.1
|
105
105
|
type: :runtime
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- - ~>
|
109
|
+
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: 0.6.1
|
112
112
|
- !ruby/object:Gem::Dependency
|
@@ -127,14 +127,14 @@ dependencies:
|
|
127
127
|
name: multi_json
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
|
-
- - ~>
|
130
|
+
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: 1.8.0
|
133
133
|
type: :runtime
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
|
-
- - ~>
|
137
|
+
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: 1.8.0
|
140
140
|
description: Replicate models across applications
|
@@ -146,18 +146,21 @@ executables:
|
|
146
146
|
extensions: []
|
147
147
|
extra_rdoc_files: []
|
148
148
|
files:
|
149
|
+
- bin/promiscuous
|
150
|
+
- lib/promiscuous.rb
|
151
|
+
- lib/promiscuous/amqp.rb
|
149
152
|
- lib/promiscuous/amqp/bunny.rb
|
150
153
|
- lib/promiscuous/amqp/fake.rb
|
151
154
|
- lib/promiscuous/amqp/file.rb
|
152
155
|
- lib/promiscuous/amqp/hot_bunnies.rb
|
153
156
|
- lib/promiscuous/amqp/null.rb
|
154
|
-
- lib/promiscuous/amqp.rb
|
155
157
|
- lib/promiscuous/autoload.rb
|
156
158
|
- lib/promiscuous/cli.rb
|
157
159
|
- lib/promiscuous/config.rb
|
158
160
|
- lib/promiscuous/convenience.rb
|
159
161
|
- lib/promiscuous/dependency.rb
|
160
162
|
- lib/promiscuous/dsl.rb
|
163
|
+
- lib/promiscuous/error.rb
|
161
164
|
- lib/promiscuous/error/base.rb
|
162
165
|
- lib/promiscuous/error/connection.rb
|
163
166
|
- lib/promiscuous/error/dependency.rb
|
@@ -166,20 +169,21 @@ files:
|
|
166
169
|
- lib/promiscuous/error/publisher.rb
|
167
170
|
- lib/promiscuous/error/recovery.rb
|
168
171
|
- lib/promiscuous/error/subscriber.rb
|
169
|
-
- lib/promiscuous/error.rb
|
170
172
|
- lib/promiscuous/key.rb
|
171
173
|
- lib/promiscuous/loader.rb
|
172
174
|
- lib/promiscuous/mongoid.rb
|
175
|
+
- lib/promiscuous/publisher.rb
|
176
|
+
- lib/promiscuous/publisher/context.rb
|
173
177
|
- lib/promiscuous/publisher/context/base.rb
|
174
178
|
- lib/promiscuous/publisher/context/transaction.rb
|
175
|
-
- lib/promiscuous/publisher/context.rb
|
176
179
|
- lib/promiscuous/publisher/mock_generator.rb
|
180
|
+
- lib/promiscuous/publisher/model.rb
|
177
181
|
- lib/promiscuous/publisher/model/active_record.rb
|
178
182
|
- lib/promiscuous/publisher/model/base.rb
|
179
183
|
- lib/promiscuous/publisher/model/ephemeral.rb
|
180
184
|
- lib/promiscuous/publisher/model/mock.rb
|
181
185
|
- lib/promiscuous/publisher/model/mongoid.rb
|
182
|
-
- lib/promiscuous/publisher/
|
186
|
+
- lib/promiscuous/publisher/operation.rb
|
183
187
|
- lib/promiscuous/publisher/operation/active_record.rb
|
184
188
|
- lib/promiscuous/publisher/operation/atomic.rb
|
185
189
|
- lib/promiscuous/publisher/operation/base.rb
|
@@ -188,30 +192,26 @@ files:
|
|
188
192
|
- lib/promiscuous/publisher/operation/non_persistent.rb
|
189
193
|
- lib/promiscuous/publisher/operation/proxy_for_query.rb
|
190
194
|
- lib/promiscuous/publisher/operation/transaction.rb
|
191
|
-
- lib/promiscuous/publisher/operation.rb
|
192
195
|
- lib/promiscuous/publisher/worker.rb
|
193
|
-
- lib/promiscuous/publisher.rb
|
194
196
|
- lib/promiscuous/railtie.rb
|
195
197
|
- lib/promiscuous/redis.rb
|
198
|
+
- lib/promiscuous/subscriber.rb
|
196
199
|
- lib/promiscuous/subscriber/message.rb
|
200
|
+
- lib/promiscuous/subscriber/model.rb
|
197
201
|
- lib/promiscuous/subscriber/model/active_record.rb
|
198
202
|
- lib/promiscuous/subscriber/model/base.rb
|
199
203
|
- lib/promiscuous/subscriber/model/mongoid.rb
|
200
204
|
- lib/promiscuous/subscriber/model/observer.rb
|
201
|
-
- lib/promiscuous/subscriber/model.rb
|
202
205
|
- lib/promiscuous/subscriber/operation.rb
|
203
206
|
- lib/promiscuous/subscriber/unit_of_work.rb
|
207
|
+
- lib/promiscuous/subscriber/worker.rb
|
204
208
|
- lib/promiscuous/subscriber/worker/eventual_destroyer.rb
|
205
209
|
- lib/promiscuous/subscriber/worker/pump.rb
|
206
210
|
- lib/promiscuous/subscriber/worker/recorder.rb
|
207
211
|
- lib/promiscuous/subscriber/worker/runner.rb
|
208
212
|
- lib/promiscuous/subscriber/worker/stats.rb
|
209
|
-
- lib/promiscuous/subscriber/worker.rb
|
210
|
-
- lib/promiscuous/subscriber.rb
|
211
213
|
- lib/promiscuous/timer.rb
|
212
214
|
- lib/promiscuous/version.rb
|
213
|
-
- lib/promiscuous.rb
|
214
|
-
- bin/promiscuous
|
215
215
|
homepage: http://github.com/crowdtap/promiscuous
|
216
216
|
licenses: []
|
217
217
|
metadata: {}
|
@@ -221,17 +221,17 @@ require_paths:
|
|
221
221
|
- lib
|
222
222
|
required_ruby_version: !ruby/object:Gem::Requirement
|
223
223
|
requirements:
|
224
|
-
- -
|
224
|
+
- - ">="
|
225
225
|
- !ruby/object:Gem::Version
|
226
226
|
version: '0'
|
227
227
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
228
228
|
requirements:
|
229
|
-
- -
|
229
|
+
- - ">="
|
230
230
|
- !ruby/object:Gem::Version
|
231
231
|
version: '0'
|
232
232
|
requirements: []
|
233
233
|
rubyforge_project:
|
234
|
-
rubygems_version: 2.0
|
234
|
+
rubygems_version: 2.2.0
|
235
235
|
signing_key:
|
236
236
|
specification_version: 4
|
237
237
|
summary: Replicate models across applications
|