skyrunner 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/generators/sky_runner/install/templates/skyrunner.rake +6 -1
- data/lib/skyrunner/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e564830013db950f0c70df94fb424e4f06c258aa
|
4
|
+
data.tar.gz: a142faeb1e1fe866666205fb44f325c53b413cea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebfd5422a912dfed0cdb2e1740428275f9354c8c0c0a9ebb2daaae29c4bba9f87f198e3eec1e24ef5c88e30941699fde2de9d2ba5b76f79e0c16d9c09a25ef13
|
7
|
+
data.tar.gz: f01549d5eb06297059ca91cabd590edf8a49f437f64736b863fd4ddc856b2f286939c0764b1765d55b75946b870e3e94eeb3541fec4ee6e5df26c65c17f5f14b
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ To set up with Rails:
|
|
17
17
|
bundle exec rails g sky_runner:install
|
18
18
|
```
|
19
19
|
|
20
|
-
|
20
|
+
Customize `config/initializers/skyrunner.rb`. Update `lib/tasks/skyrunner.rake` to do what you want if there are exceptions during a task.
|
21
21
|
|
22
22
|
To initialize DynamoDB & SQS:
|
23
23
|
|
@@ -33,5 +33,5 @@ bundle exec rake skyrunner:consume
|
|
33
33
|
|
34
34
|
See `jobs/example_job.rb` for an example job. To run a job, just call `execute!` on the job, passing any named job arguments you want. The job class should implement the method `run`. This method will get passed the job arguments. For each task you want consumers to run, `run` should yield an array of two elements, the first being the name of the method on the job class to run for the task, and the second a Hash of method arguments.
|
35
35
|
|
36
|
-
You can specify `on_complete` and `on_failure`
|
36
|
+
You can specify `on_complete` and `on_failure` method(s) to call when the tasks are all completed, or if any of them fail, respectively. These methods will also be passed the original job arguments. Importantly, the completion method is guaranteed to be called once and only once, when the final task has been completed.
|
37
37
|
|
@@ -6,7 +6,12 @@ namespace :skyrunner do
|
|
6
6
|
|
7
7
|
desc "Creates DynamoDB table and SQS queue for SkyRunner."
|
8
8
|
task consume: :environment do
|
9
|
-
SkyRunner.consume!
|
9
|
+
SkyRunner.consume! do |exception|
|
10
|
+
if exception
|
11
|
+
# TODO customize this with what you want to do if there is an exception.
|
12
|
+
# (For example, send to Airbrake.)
|
13
|
+
end
|
14
|
+
end
|
10
15
|
end
|
11
16
|
|
12
17
|
desc "Purges and re-creates DynamoDB table and SQS queue for SkyRunner. (Warning: destructive!)"
|
data/lib/skyrunner/version.rb
CHANGED