boss_queue 0.2.0 → 0.2.1
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.
- data/README.md +1 -0
- data/VERSION +1 -1
- data/boss_queue.gemspec +1 -1
- data/lib/boss_queue/boss_queue.rb +3 -3
- metadata +2 -2
data/README.md
CHANGED
@@ -71,6 +71,7 @@ Usage
|
|
71
71
|
queue.enqueue(MyClass, :method_to_execute)
|
72
72
|
queue.enqueue_with_delay(60, MyClass, :method_to_execute, arg1, arg2)
|
73
73
|
|
74
|
+
# work returns true if a job was pulled from the queue, false otherwise
|
74
75
|
queue.work
|
75
76
|
|
76
77
|
# failures are left in the DynamoDB table with the failed boolean set to true
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/boss_queue.gemspec
CHANGED
@@ -37,18 +37,18 @@ class BossQueue
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def work
|
40
|
-
|
40
|
+
job_dequeued = false
|
41
41
|
sqs_queue.receive_message do |job_id|
|
42
|
+
job_dequeued = true
|
42
43
|
# When a block is given, each message is yielded to the block and then deleted as long as the block exits normally - http://docs.aws.amazon.com/AWSRubySDK/latest/frames.html
|
43
44
|
begin
|
44
45
|
job = BossQueue::Job.shard(table_name).find(job_id.body)
|
45
46
|
job.sqs_queue = sqs_queue
|
46
47
|
job.work
|
47
|
-
work_done = true
|
48
48
|
rescue AWS::Record::RecordNotFound
|
49
49
|
end
|
50
50
|
end
|
51
|
-
|
51
|
+
job_dequeued
|
52
52
|
end
|
53
53
|
|
54
54
|
def enqueue(class_or_instance, method_name, *args)
|
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.1
|
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: 2034341931255637355
|
164
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
165
|
none: false
|
166
166
|
requirements:
|