stud 0.0.2 → 0.0.5
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 +4 -5
- metadata +2 -3
- data/lib/stud/supervise.rb +0 -26
data/README.md
CHANGED
@@ -14,11 +14,10 @@ each 'pattern' are quite small by code size.
|
|
14
14
|
|
15
15
|
## Features
|
16
16
|
|
17
|
-
* retry on failure, with back-off, where failure is any exception.
|
18
|
-
* generic resource pools
|
19
|
-
*
|
20
|
-
*
|
21
|
-
* interval execution (do X every N seconds)
|
17
|
+
* {Stud::Try} (and {Stud.try}) - retry on failure, with back-off, where failure is any exception.
|
18
|
+
* {Stud::Pool} - generic resource pools
|
19
|
+
* {Stud::Task} - tasks (threads that can return values, exceptions, etc)
|
20
|
+
* {Stud.interval} - interval execution (do X every N seconds)
|
22
21
|
|
23
22
|
## TODO:
|
24
23
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -54,7 +54,6 @@ files:
|
|
54
54
|
- lib/stud/pool.rb
|
55
55
|
- lib/stud/interval.rb
|
56
56
|
- lib/stud/try.rb
|
57
|
-
- lib/stud/supervise.rb
|
58
57
|
- LICENSE
|
59
58
|
- CHANGELIST
|
60
59
|
- README.md
|
data/lib/stud/supervise.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
module Stud
|
2
|
-
class Supervisor
|
3
|
-
def initialize(*args, &block)
|
4
|
-
@args = args
|
5
|
-
@block = block
|
6
|
-
|
7
|
-
run
|
8
|
-
end # def initialize
|
9
|
-
|
10
|
-
def run
|
11
|
-
while true
|
12
|
-
task = Task.new(*@args, &@block)
|
13
|
-
begin
|
14
|
-
puts :result => task.wait
|
15
|
-
rescue => e
|
16
|
-
puts e
|
17
|
-
puts e.backtrace
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end # def run
|
21
|
-
end # class Supervisor
|
22
|
-
|
23
|
-
def self.supervise(&block)
|
24
|
-
Supervisor.new(&block)
|
25
|
-
end # def supervise
|
26
|
-
end # module Stud
|