iron_consumer 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d3ab5f444f7c6b14b0c85c5f01a289e960b5627
4
- data.tar.gz: 71cac9db31eff1453278d350906cf571de024fd4
3
+ metadata.gz: 12978166e44f7bf73eff816047d66f2c825486eb
4
+ data.tar.gz: 8db94f2857b78257382a473cdc9c6149e452ba05
5
5
  SHA512:
6
- metadata.gz: f075c90d35c046ba1aab75bf8a79958afb722872f68a5f7091c8c167d4ecdca6c0de3fbfa8f49d55f1a71fda0c5f41894cfa7ca7c58bbf9212e1677e313fa327
7
- data.tar.gz: 40947b03baea0f5c8c9b71e530160d54465cbb76843fa4f8d7082fff2e5ee10f67479c3d894eb9e9d5d3c5f8609c5309ca8d82dcdec36ff2465bcdd685804765
6
+ metadata.gz: 9399e50e5d0398f2e017513315e3bfb3d91ee1a9cbf1edc19082d638cd63829d89d8840de440535dbb67292f6625d7aaaf49ce81b417a9b232bb9dba2e234c4e
7
+ data.tar.gz: 6c7bd7eb1120612c95aac235fce9a3d16906d20e5dcb5582a0cb96ffa2330d1dfdb665c641c42bb7481bf7bad228d3977bd64bbac058e4bf8707806becbec070
data/README.md CHANGED
@@ -76,7 +76,7 @@ Just create a simple file called `local.rb` and put this in it:
76
76
 
77
77
  ```ruby
78
78
  require 'iron_consumer'
79
- IronConsumer.run('my_queue')
79
+ IronConsumer.run(workqueue: 'my_queue')
80
80
  ```
81
81
 
82
82
  Once you've got it working, just upload it to IronWorker.
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 "usersetup.rb"
17
+ load setupfile
17
18
  rescue LoadError => ex
18
19
  p ex
19
20
  puts ex.message
20
- puts "You need a file called usersetup.rb."
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 "usercode.rb"
57
+ load codefile
54
58
  rescue LoadError => ex
55
59
  p ex
56
- puts "You need a file called usercode.rb."
60
+ puts "You need a file called #{codefile}."
57
61
  exit false
58
62
  end
59
63
  # USER CODE END
@@ -1,4 +1,4 @@
1
1
  module IronConsumer
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron_consumer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Reeder