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 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 # default queue name
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
- BossQueue.create_table
52
- BossQueue.create_queue
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
1
+ 0.2.2
data/boss_queue.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "boss_queue"
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Daniel Nelson"]
@@ -33,7 +33,12 @@ class BossQueue
33
33
  end
34
34
 
35
35
  def create_queue
36
- AWS::SQS::QueueCollection.new.create(queue_name, :default_visibility_timeout => 5 * 60)
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.1
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: 2034341931255637355
163
+ hash: 3332988464044131745
164
164
  required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  none: false
166
166
  requirements: