redact 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README +7 -5
- data/lib/redact.rb +4 -3
- 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: 92fe2cc4165eba5df9ffb49350fbe5587fd2ed29
|
4
|
+
data.tar.gz: db2eb0b34a3ce23652c943583871d36bcc0f76a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e942b6787910841de8aa3f62f2c4cd207aad94e4aff42d6c2598db7a4cb8fb3f3445d53e0711672646e0aa2ef46394f138778dda56675cd74c0e174bd04faeeb
|
7
|
+
data.tar.gz: 4acfc6e935e61db87cc1d9fe844866eb3894cc3b2bbe3896e42a04a2f9a5f4130cb61cdf1a32eba9cde07ffe7cbd87bfcf5507b6b7e57d8b4c22d6381afe697d
|
data/README
CHANGED
@@ -3,17 +3,19 @@ your work as a set of tasks that are dependent on other tasks, and to execute
|
|
3
3
|
runs across this graph, in such a way that all dependencies for a task are
|
4
4
|
guaranteed to be satisfied before the task itself is executed.
|
5
5
|
|
6
|
-
It does everything you'd expect from a production
|
7
|
-
* You can
|
8
|
-
* You can have arbitrary concurrent runs through the task graph.
|
6
|
+
It does everything you'd expect from a production system:
|
7
|
+
* You can have an arbitrary number of worker processes.
|
8
|
+
* You can have an arbitrary number of concurrent runs through the task graph.
|
9
9
|
* An application exception causes the task to be retried a fixed number of times.
|
10
10
|
* Tasks lost as part of an application crash or Ruby segfault are recoverable.
|
11
11
|
|
12
12
|
For debugging purposes, you can use Redact#enqueued_tasks, #in_progress_tasks,
|
13
13
|
and #done_tasks to iterate over all tasks, past and present. Note that the
|
14
14
|
output from these methods may change rapidly, and that calls are not guaranteed
|
15
|
-
to be consisent with each other.
|
16
|
-
|
15
|
+
to be consisent with each other.
|
16
|
+
|
17
|
+
The gem provides a simple web server (bin/redact-monitor) for visualizing the
|
18
|
+
current state of the planner and worker processes.
|
17
19
|
|
18
20
|
== Synopsis
|
19
21
|
|
data/lib/redact.rb
CHANGED
@@ -49,9 +49,10 @@ class Redact
|
|
49
49
|
##
|
50
50
|
## Raises a CyclicDependencyError exception if adding these dependencies
|
51
51
|
## would result in a cyclic dependency.
|
52
|
-
def add_task what, *deps
|
53
|
-
|
54
|
-
task ids" unless deps.all? { |x| x.is_a?(Symbol) }
|
52
|
+
def add_task what, *deps
|
53
|
+
deps = deps.flatten # be nice and allow arrays to be passed in
|
54
|
+
raise ArgumentError, "expecting dependencies to be zero or more task ids" unless deps.all? { |x| x.is_a?(Symbol) }
|
55
|
+
@dag[what] = deps
|
55
56
|
|
56
57
|
@dag.strongly_connected_components.each do |x|
|
57
58
|
raise CyclicDependencyError, "cyclic dependency #{x.inspect}" if x.size != 1
|