amirka-async-fu 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +11 -4
  2. data/VERSION.yml +1 -1
  3. data/lib/async_fu.rb +0 -1
  4. 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
- === Interitence usage
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
- You do not need more to use join method to lock threads, if you not use it for some reasons.
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
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 1
4
- :patch: 1
4
+ :patch: 2
data/lib/async_fu.rb CHANGED
@@ -2,7 +2,6 @@ require 'fastthread'
2
2
  class AsyncFu
3
3
  def initialize(obj = nil)
4
4
  @class = obj || self
5
- @guard = Mutex.new
6
5
  at_exit{
7
6
  unless @exit
8
7
  until Thread.list.size == 1 do Thread.pass end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amirka-async-fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amir Mamedov