boss_queue 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -5
- data/VERSION +1 -1
- data/boss_queue.gemspec +1 -1
- data/lib/boss_queue/boss_queue.rb +6 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -19,9 +19,7 @@ boss_queue uses an Amazon SQS queue and a Amazon DynamoDB table for each environ
|
|
19
19
|
AWS.config(:access_key_id => <access_key_id>,
|
20
20
|
:secret_access_key => <secret_access_key>)
|
21
21
|
|
22
|
-
queue = BossQueue.new
|
23
|
-
# or
|
24
|
-
queue = BossQueue.new(:queue => 'emails') # customized queue name (so you can have separate job queues)
|
22
|
+
queue = BossQueue.new
|
25
23
|
|
26
24
|
BossQueue.environment = 'development'
|
27
25
|
queue.create_table
|
@@ -39,6 +37,13 @@ boss_queue uses an Amazon SQS queue and a Amazon DynamoDB table for each environ
|
|
39
37
|
queue.create_table(50, 10)
|
40
38
|
queue.create_queue
|
41
39
|
|
40
|
+
# you can also have customized queue names for separate job queues
|
41
|
+
# (only create the queue again...a single DynamoDB table serves all the queues)
|
42
|
+
queue = BossQueue.new(:queue => 'emails')
|
43
|
+
queue.create_queue
|
44
|
+
queue = BossQueue.new(:queue => 'image_processing')
|
45
|
+
queue.create_queue
|
46
|
+
|
42
47
|
|
43
48
|
Alternatively, in each of the respective environments, do:
|
44
49
|
|
@@ -46,10 +51,11 @@ Alternatively, in each of the respective environments, do:
|
|
46
51
|
|
47
52
|
AWS.config(:access_key_id => <access_key_id>,
|
48
53
|
:secret_access_key => <secret_access_key>)
|
54
|
+
queue = BossQueue.new
|
49
55
|
|
50
56
|
# environment does not need to be set because it is taken from Rails.env
|
51
|
-
|
52
|
-
|
57
|
+
queue.create_table(50, 10)
|
58
|
+
queue.create_queue
|
53
59
|
|
54
60
|
|
55
61
|
Or these could be put into a migration.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/boss_queue.gemspec
CHANGED
@@ -33,7 +33,12 @@ class BossQueue
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def create_queue
|
36
|
-
|
36
|
+
# small message size because we are only sending id
|
37
|
+
# 5 second delay so that we can use eventually consistent reads in DynamoDB
|
38
|
+
AWS::SQS::QueueCollection.new.create(queue_name, :visibility_timeout => 180,
|
39
|
+
:maximum_message_size => 128,
|
40
|
+
:delay_seconds => 5,
|
41
|
+
:message_retention_period => 1209600)
|
37
42
|
end
|
38
43
|
|
39
44
|
def work
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boss_queue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -160,7 +160,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
160
|
version: '0'
|
161
161
|
segments:
|
162
162
|
- 0
|
163
|
-
hash:
|
163
|
+
hash: 3332988464044131745
|
164
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
165
|
none: false
|
166
166
|
requirements:
|