procemon 0.3.2 → 0.3.3
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
CHANGED
@@ -33,6 +33,9 @@ the "simple async processing" will let you use os threads (1.9.n+)
|
|
33
33
|
for multiprocessing so you can give multiple task to do and
|
34
34
|
until you ask for the value, the process will be in the background
|
35
35
|
|
36
|
+
the "require_files" shows you how can you get files from directory
|
37
|
+
in a recursive way and stuffs like that so you can be lay
|
38
|
+
|
36
39
|
## LICENSE
|
37
40
|
|
38
41
|
(The MIT License)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
@@ -11,32 +11,24 @@ class Async #< BasicObject
|
|
11
11
|
undef_method method
|
12
12
|
end
|
13
13
|
|
14
|
-
@@max_retry ||= 6
|
15
14
|
def initialize(callable)
|
16
|
-
retry_times= nil
|
17
15
|
begin
|
16
|
+
@rescue_state= nil
|
18
17
|
@thread ||= ::Thread.new { callable.call }
|
18
|
+
@rescue_state= nil
|
19
19
|
rescue ThreadError
|
20
|
-
|
21
|
-
retry_times += 1
|
20
|
+
@rescue_state ||= true
|
22
21
|
sleep 5
|
23
|
-
|
24
|
-
retry
|
25
|
-
else
|
26
|
-
@thread ||= callable.call
|
27
|
-
end
|
22
|
+
retry
|
28
23
|
end
|
29
24
|
end
|
30
25
|
|
31
26
|
def value
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
#end
|
37
|
-
|
27
|
+
until @rescue_state.nil?
|
28
|
+
puts "hahaha"
|
29
|
+
sleep 1
|
30
|
+
end
|
38
31
|
return @thread.value
|
39
|
-
|
40
32
|
end
|
41
33
|
|
42
34
|
def inspect
|
@@ -55,4 +47,4 @@ class Async #< BasicObject
|
|
55
47
|
value.respond_to?(method, include_private)
|
56
48
|
end
|
57
49
|
|
58
|
-
end
|
50
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: procemon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -29,7 +29,8 @@ files:
|
|
29
29
|
- VERSION
|
30
30
|
- examples/fun_with_procs_and_methods.rb
|
31
31
|
- examples/how_to_inject_with_extra_process_a_method.rb
|
32
|
-
- examples/
|
32
|
+
- examples/require_files.rb
|
33
|
+
- examples/simple_async_processing.rb
|
33
34
|
- files.rb
|
34
35
|
- lib/procemon.rb
|
35
36
|
- lib/procemon/extra/str2duck.rb
|
File without changes
|