amirka-async-fu 1.1.1 → 1.1.2
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.rdoc +11 -4
- data/VERSION.yml +1 -1
- data/lib/async_fu.rb +0 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -2,12 +2,11 @@
|
|
2
2
|
|
3
3
|
async-fu improve your code with abilities to run long task in threaded way
|
4
4
|
|
5
|
-
|
6
5
|
== Examples
|
7
6
|
=== Simple usage
|
7
|
+
|
8
8
|
class YourClass1
|
9
9
|
def hello
|
10
|
-
p 'incapsulated test'
|
11
10
|
p 'start'
|
12
11
|
p 'list ' + Thread.list.join( ' ')
|
13
12
|
p 'main ' + Thread.main.to_s
|
@@ -19,7 +18,8 @@ end
|
|
19
18
|
af = AsyncFu.new(YourClass1.new)
|
20
19
|
|
21
20
|
af.hello
|
22
|
-
===
|
21
|
+
=== Inheritance usage
|
22
|
+
|
23
23
|
class YourClass2 < AsyncFu
|
24
24
|
def hello
|
25
25
|
p 'start'
|
@@ -34,20 +34,27 @@ ai = YourClass2.new
|
|
34
34
|
|
35
35
|
ai.hello
|
36
36
|
=== Thread exit solution
|
37
|
-
|
37
|
+
|
38
|
+
You don't need more using join method to lock threads, if you not use it for some reasons.
|
38
39
|
|
39
40
|
AsyncFu catch exit of ruby program and check for live threads pass main thread until they ended.
|
40
41
|
|
41
42
|
If you don't need this futures, you can switch it off by using exit method of AsyncFu class.
|
43
|
+
|
42
44
|
== TODO
|
45
|
+
|
43
46
|
=== 1.x.x
|
47
|
+
|
44
48
|
* callbacks
|
45
49
|
|
46
50
|
=== 2.x.x
|
51
|
+
|
47
52
|
* add mixin style
|
53
|
+
|
48
54
|
YourClass
|
49
55
|
include async-fu
|
50
56
|
end
|
57
|
+
|
51
58
|
== Copyright
|
52
59
|
|
53
60
|
Copyright (c) 2009 Amir Mamedov. See LICENSE for details.
|
data/VERSION.yml
CHANGED
data/lib/async_fu.rb
CHANGED