iron_consumer 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36b0592cf83cd0c6384343ad9c457993aa98905b
4
- data.tar.gz: ced49f93b794c856dc8deef64fab45758a4e747f
3
+ metadata.gz: 0d3ab5f444f7c6b14b0c85c5f01a289e960b5627
4
+ data.tar.gz: 71cac9db31eff1453278d350906cf571de024fd4
5
5
  SHA512:
6
- metadata.gz: 821b42dad4342d23b97c5214869bc6d641a290cea599946582722b6e98ce08997843de8bddbf066bd0ee1a7f51e5ade89ce29591642058938809c57be2425cfb
7
- data.tar.gz: ed0b3b6e11ae44cb285d82af3afba77ff9dd34507dbb0e43b0aca838729572b6b7bc1bc3b47f04a017f4fb9f40afb83d83e5dc7545e76eeefc88cba7a366e578
6
+ metadata.gz: f075c90d35c046ba1aab75bf8a79958afb722872f68a5f7091c8c167d4ecdca6c0de3fbfa8f49d55f1a71fda0c5f41894cfa7ca7c58bbf9212e1677e313fa327
7
+ data.tar.gz: 40947b03baea0f5c8c9b71e530160d54465cbb76843fa4f8d7082fff2e5ee10f67479c3d894eb9e9d5d3c5f8609c5309ca8d82dcdec36ff2465bcdd685804765
data/README.md CHANGED
@@ -1,9 +1,16 @@
1
- This is a special way to make a worker that runs for a while and pulls off IronMQ.
1
+ This is a gem to help make it easier to make a worker that runs for a while and pulls off IronMQ for processing. This is particularly good for short quick jobs like sending notifications and what not, things that take a few seconds or less.
2
+
3
+ The framework basically has two files you put your code in:
4
+
5
+ 1. usersetup.rb - this is where you setup database connections and other client libs to connect to other services.
6
+ 2. usercode.rb - this is where the actually work goes and you can use your connections from usersetup.rb in here.
7
+
8
+ Then you just upload your worker as usual, set a schedule or alert pattern and you're done.
2
9
 
3
10
  Benefits:
4
11
 
5
- - no load times so faster and cheaper
6
- - can run locally and remote in the same way
12
+ - Only loads once so jobs can process faster and cheaper
13
+ - Can run locally and remote in the same way
7
14
  - HUD could have easy editor (usersetup and usercode text boxes)
8
15
 
9
16
  Can use with scheduler or alerts.
data/lib/iron_consumer.rb CHANGED
@@ -6,8 +6,8 @@ require_relative 'helpers'
6
6
 
7
7
  module IronConsumer
8
8
 
9
- def self.run(queue_name)
10
- qname = queue_name
9
+ def self.run(config)
10
+ qname = config['workqueue']
11
11
 
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.
@@ -25,7 +25,7 @@ module IronConsumer
25
25
  # Other connections would be made here
26
26
 
27
27
  # Iron stuff is setup too:
28
- mq = IronMQ::Client.new()
28
+ mq = IronMQ::Client.new(config['iron'])
29
29
 
30
30
  # qname defined by user too
31
31
  queue = mq.queue(qname)
@@ -1,4 +1,4 @@
1
1
  module IronConsumer
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron_consumer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Reeder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-17 00:00:00.000000000 Z
11
+ date: 2014-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iron_mq
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: 1.3.6
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 2.0.3
115
+ rubygems_version: 2.2.2
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: Ruby client for IronWorker by www.iron.io