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 +4 -4
- data/README.md +10 -3
- data/lib/iron_consumer.rb +3 -3
- data/lib/iron_consumer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d3ab5f444f7c6b14b0c85c5f01a289e960b5627
|
4
|
+
data.tar.gz: 71cac9db31eff1453278d350906cf571de024fd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f075c90d35c046ba1aab75bf8a79958afb722872f68a5f7091c8c167d4ecdca6c0de3fbfa8f49d55f1a71fda0c5f41894cfa7ca7c58bbf9212e1677e313fa327
|
7
|
+
data.tar.gz: 40947b03baea0f5c8c9b71e530160d54465cbb76843fa4f8d7082fff2e5ee10f67479c3d894eb9e9d5d3c5f8609c5309ca8d82dcdec36ff2465bcdd685804765
|
data/README.md
CHANGED
@@ -1,9 +1,16 @@
|
|
1
|
-
This is a
|
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
|
-
-
|
6
|
-
-
|
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(
|
10
|
-
qname =
|
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)
|
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.
|
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-
|
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.
|
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
|