foreverb 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.md +1 -1
- data/bin/foreverb +0 -1
- data/examples/sample +33 -33
- data/lib/forever/version.rb +1 -1
- metadata +3 -4
data/CHANGES.md
CHANGED
data/bin/foreverb
CHANGED
data/examples/sample
CHANGED
@@ -10,42 +10,42 @@ Forever.run do
|
|
10
10
|
puts "All jobs will will wait me for 1 second"; sleep 1
|
11
11
|
end
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
13
|
+
every 5.seconds, :last => Time.now do
|
14
|
+
puts "Every 5 seconds from start"
|
15
|
+
end
|
16
|
+
|
17
|
+
every 30.seconds, :last => Time.now do
|
18
|
+
puts "Every 30 seconds from start with boom"
|
19
|
+
raise "woooooa"
|
20
|
+
end
|
21
|
+
|
22
|
+
every 10.seconds, :at => "#{Time.now.hour}:00" do
|
23
|
+
puts "Every 10 seconds but first call at #{Time.now.hour}:00"
|
24
|
+
end
|
25
|
+
|
26
|
+
every 1.seconds, :at => "#{Time.now.hour}:#{Time.now.min+1}" do
|
27
|
+
puts "Every one second but first call at #{Time.now.hour}:#{Time.now.min}"
|
28
|
+
end
|
29
|
+
|
30
30
|
every 10.seconds do
|
31
31
|
puts "Every 10 second"
|
32
32
|
end
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
33
|
+
|
34
|
+
every 20.seconds do
|
35
|
+
puts "Every 20 second"
|
36
|
+
end
|
37
|
+
|
38
|
+
every 15.seconds do
|
39
|
+
puts "Every 15 seconds, but my task require 10 seconds"; sleep 10
|
40
|
+
end
|
41
|
+
|
42
|
+
every 10.seconds, :at => [":#{Time.now.min+1}", ":#{Time.now.min+2}"] do
|
43
|
+
puts "Every 10 seconds but first call at xx:#{Time.now.min}"
|
44
|
+
end
|
45
|
+
|
46
|
+
on_error do |e|
|
47
|
+
puts "Boom raised: #{e.message}"
|
48
|
+
end
|
49
49
|
|
50
50
|
on_exit do
|
51
51
|
puts "Bye bye"
|
data/lib/forever/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreverb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- DAddYE
|
@@ -51,7 +51,6 @@ files:
|
|
51
51
|
- Rakefile
|
52
52
|
- bin/foreverb
|
53
53
|
- examples/sample
|
54
|
-
- examples/tmp/sample.pid
|
55
54
|
- foreverb.gemspec
|
56
55
|
- lib/forever.rb
|
57
56
|
- lib/forever/base.rb
|