iron_consumer 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/iron_consumer.rb +8 -4
- data/lib/iron_consumer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12978166e44f7bf73eff816047d66f2c825486eb
|
4
|
+
data.tar.gz: 8db94f2857b78257382a473cdc9c6149e452ba05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9399e50e5d0398f2e017513315e3bfb3d91ee1a9cbf1edc19082d638cd63829d89d8840de440535dbb67292f6625d7aaaf49ce81b417a9b232bb9dba2e234c4e
|
7
|
+
data.tar.gz: 6c7bd7eb1120612c95aac235fce9a3d16906d20e5dcb5582a0cb96ffa2330d1dfdb665c641c42bb7481bf7bad228d3977bd64bbac058e4bf8707806becbec070
|
data/README.md
CHANGED
data/lib/iron_consumer.rb
CHANGED
@@ -12,15 +12,18 @@ module IronConsumer
|
|
12
12
|
# User can have whatever he wants in the usersetup part.
|
13
13
|
# We can put the helpers stuff in a gem that user can optionally use or something.
|
14
14
|
|
15
|
+
setupfile = config['setup'] || "usersetup.rb"
|
15
16
|
begin
|
16
|
-
load
|
17
|
+
load setupfile
|
17
18
|
rescue LoadError => ex
|
18
19
|
p ex
|
19
20
|
puts ex.message
|
20
|
-
puts "You need a file called
|
21
|
+
puts "You need a file called #{setupfile}"
|
21
22
|
exit false
|
22
23
|
end
|
23
24
|
|
25
|
+
codefile = config['code'] || "usercode.rb"
|
26
|
+
|
24
27
|
# mongo1 name is defined by user
|
25
28
|
# Other connections would be made here
|
26
29
|
|
@@ -40,6 +43,7 @@ module IronConsumer
|
|
40
43
|
# sleep for a short time to see if we can get another one
|
41
44
|
tries += 1
|
42
45
|
if tries >= max_tries
|
46
|
+
puts "No more messages to process, shutting down."
|
43
47
|
break
|
44
48
|
end
|
45
49
|
sleep sleep_time
|
@@ -50,10 +54,10 @@ module IronConsumer
|
|
50
54
|
|
51
55
|
# USER CODE STUFFED IN HERE
|
52
56
|
begin
|
53
|
-
load
|
57
|
+
load codefile
|
54
58
|
rescue LoadError => ex
|
55
59
|
p ex
|
56
|
-
puts "You need a file called
|
60
|
+
puts "You need a file called #{codefile}."
|
57
61
|
exit false
|
58
62
|
end
|
59
63
|
# USER CODE END
|