untied-consumer 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.mkd +3 -0
- data/README.md +3 -0
- data/Rakefile +10 -1
- data/lib/untied-consumer/config.rb +1 -0
- data/lib/untied-consumer/version.rb +1 -1
- data/lib/untied-consumer/worker.rb +16 -1
- metadata +135 -140
data/CHANGELOG.mkd
ADDED
data/README.md
CHANGED
@@ -4,6 +4,9 @@ This is the consumer part of Untied. Untied is an observer pattern implementatio
|
|
4
4
|
|
5
5
|
For usage information, please visit the [Untied](http://github.com.br/redu/untied) page.
|
6
6
|
|
7
|
+
**Build status**
|
8
|
+
|
9
|
+
[![Build Status](https://travis-ci.org/redu/untied-consumer.png)](https://travis-ci.org/redu/untied-consumer)
|
7
10
|
|
8
11
|
## Installation
|
9
12
|
|
data/Rakefile
CHANGED
@@ -14,7 +14,22 @@ module Untied
|
|
14
14
|
def start
|
15
15
|
@channel.queue(@queue_name, :exclusive => true) do |queue|
|
16
16
|
queue.bind(@exchange, :routing_key => "untied.#").subscribe do |h,p|
|
17
|
-
@consumer.process(h,p)
|
17
|
+
safe_process { @consumer.process(h,p) }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
protected
|
23
|
+
|
24
|
+
def safe_process(&block)
|
25
|
+
begin
|
26
|
+
yield
|
27
|
+
rescue => e
|
28
|
+
if Consumer.config.abort_on_exception
|
29
|
+
raise e
|
30
|
+
else
|
31
|
+
Consumer.config.logger.error e.message
|
32
|
+
Consumer.config.logger.error e.backtrace.join("\n\t")
|
18
33
|
end
|
19
34
|
end
|
20
35
|
end
|
metadata
CHANGED
@@ -1,154 +1,148 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: untied-consumer
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Guilherme Cavalcanti
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
17
|
+
|
18
|
+
date: 2012-10-23 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
22
|
+
none: false
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
hash: 3
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
prerelease: false
|
22
31
|
type: :development
|
32
|
+
name: rspec
|
33
|
+
requirement: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
hash: 3
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
version: "0"
|
23
44
|
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '0'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: sqlite3
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
38
45
|
type: :development
|
46
|
+
name: sqlite3
|
47
|
+
requirement: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
hash: 3
|
55
|
+
segments:
|
56
|
+
- 0
|
57
|
+
version: "0"
|
39
58
|
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: rake
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
59
|
type: :development
|
60
|
+
name: rake
|
61
|
+
requirement: *id003
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
hash: 3
|
69
|
+
segments:
|
70
|
+
- 0
|
71
|
+
version: "0"
|
55
72
|
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: activemodel
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
73
|
type: :runtime
|
74
|
+
name: activemodel
|
75
|
+
requirement: *id004
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
hash: 3
|
83
|
+
segments:
|
84
|
+
- 0
|
85
|
+
version: "0"
|
71
86
|
prerelease: false
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ! '>='
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '0'
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: amqp
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - ! '>='
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '0'
|
86
87
|
type: :runtime
|
88
|
+
name: amqp
|
89
|
+
requirement: *id005
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
hash: 3
|
97
|
+
segments:
|
98
|
+
- 0
|
99
|
+
version: "0"
|
87
100
|
prerelease: false
|
88
|
-
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ! '>='
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '0'
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: configurable
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ! '>='
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '0'
|
102
101
|
type: :runtime
|
102
|
+
name: configurable
|
103
|
+
requirement: *id006
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
hash: 3
|
111
|
+
segments:
|
112
|
+
- 0
|
113
|
+
version: "0"
|
103
114
|
prerelease: false
|
104
|
-
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ! '>='
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0'
|
110
|
-
- !ruby/object:Gem::Dependency
|
111
|
-
name: json
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
|
-
requirements:
|
115
|
-
- - ! '>='
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
115
|
type: :runtime
|
116
|
+
name: json
|
117
|
+
requirement: *id007
|
118
|
+
- !ruby/object:Gem::Dependency
|
119
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
hash: 3
|
125
|
+
segments:
|
126
|
+
- 0
|
127
|
+
version: "0"
|
119
128
|
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- - ! '>='
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '0'
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: debugger
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
|
-
requirements:
|
131
|
-
- - ! '>='
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version: '0'
|
134
129
|
type: :development
|
135
|
-
|
136
|
-
|
137
|
-
none: false
|
138
|
-
requirements:
|
139
|
-
- - ! '>='
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
version: '0'
|
130
|
+
name: ruby-debug
|
131
|
+
requirement: *id008
|
142
132
|
description: Provides the Consumer part of the Untied gem.
|
143
|
-
email:
|
133
|
+
email:
|
144
134
|
- guiocavalcanti@gmail.com
|
145
135
|
executables: []
|
136
|
+
|
146
137
|
extensions: []
|
138
|
+
|
147
139
|
extra_rdoc_files: []
|
148
|
-
|
140
|
+
|
141
|
+
files:
|
149
142
|
- .gitignore
|
150
143
|
- .rvmrc
|
151
144
|
- .travis.yml
|
145
|
+
- CHANGELOG.mkd
|
152
146
|
- Gemfile
|
153
147
|
- LICENSE.txt
|
154
148
|
- README.md
|
@@ -170,37 +164,38 @@ files:
|
|
170
164
|
- untied-consumer.gemspec
|
171
165
|
homepage: http://github.com/redu/untied
|
172
166
|
licenses: []
|
167
|
+
|
173
168
|
post_install_message:
|
174
169
|
rdoc_options: []
|
175
|
-
|
170
|
+
|
171
|
+
require_paths:
|
176
172
|
- lib
|
177
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
173
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
178
174
|
none: false
|
179
|
-
requirements:
|
180
|
-
- -
|
181
|
-
- !ruby/object:Gem::Version
|
182
|
-
|
183
|
-
segments:
|
175
|
+
requirements:
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
hash: 3
|
179
|
+
segments:
|
184
180
|
- 0
|
185
|
-
|
186
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
|
+
version: "0"
|
182
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
183
|
none: false
|
188
|
-
requirements:
|
189
|
-
- -
|
190
|
-
- !ruby/object:Gem::Version
|
191
|
-
|
192
|
-
segments:
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
hash: 3
|
188
|
+
segments:
|
193
189
|
- 0
|
194
|
-
|
190
|
+
version: "0"
|
195
191
|
requirements: []
|
192
|
+
|
196
193
|
rubyforge_project:
|
197
194
|
rubygems_version: 1.8.24
|
198
195
|
signing_key:
|
199
196
|
specification_version: 3
|
200
|
-
summary: Untied is a Observer Pattern implementation for distributed systems. Think
|
201
|
-
|
202
|
-
events
|
203
|
-
test_files:
|
197
|
+
summary: Untied is a Observer Pattern implementation for distributed systems. Think as a cross-application ActiveRecord::Observer. This gem handles the listening of events
|
198
|
+
test_files:
|
204
199
|
- spec/event_spec.rb
|
205
200
|
- spec/observer_spec.rb
|
206
201
|
- spec/processor_spec.rb
|