xpool 0.1.0 → 0.1.1
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 +35 -30
- data/lib/xpool/version.rb +1 -1
- data/xpool.gemspec +1 -1
- metadata +5 -5
data/README.md
CHANGED
@@ -27,46 +27,51 @@ _1._
|
|
27
27
|
|
28
28
|
A demo of how you'd create a pool of 10 subprocesses:
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
30
|
+
```ruby
|
31
|
+
#
|
32
|
+
# Make sure you define your units of work before
|
33
|
+
# you create a process pool or you'll get strange
|
34
|
+
# serialization errors.
|
35
|
+
#
|
36
|
+
class Unit
|
37
|
+
def run
|
38
|
+
sleep 1
|
39
|
+
end
|
40
|
+
end
|
41
|
+
pool = XPool.new 10
|
42
|
+
5.times { pool.schedule Unit.new }
|
43
|
+
pool.shutdown
|
44
|
+
```
|
43
45
|
|
44
46
|
_2._
|
45
47
|
|
46
48
|
A demo of how you'd resize the pool from 10 to 5 subprocesses at runtime:
|
47
49
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
50
|
+
```ruby
|
51
|
+
class Unit
|
52
|
+
def run
|
53
|
+
sleep 5
|
54
|
+
end
|
55
|
+
end
|
56
|
+
pool = XPool.new 10
|
57
|
+
pool.resize! 1..5
|
58
|
+
pool.shutdown
|
59
|
+
```
|
57
60
|
_3._
|
58
61
|
|
59
62
|
A demo of how you'd gracefully shutdown but force a hard shutdown if 3 seconds
|
60
63
|
pass by & all subprocesses have not exited:
|
61
64
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
65
|
+
```ruby
|
66
|
+
class Unit
|
67
|
+
def run
|
68
|
+
sleep 5
|
69
|
+
end
|
70
|
+
end
|
71
|
+
pool = XPool.new 10
|
72
|
+
pool.schedule Unit.new
|
73
|
+
pool.shutdown 3
|
74
|
+
```
|
70
75
|
|
71
76
|
__INSTALL__
|
72
77
|
|
data/lib/xpool/version.rb
CHANGED
data/xpool.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xpool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 5.0.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 5.0.1
|
30
30
|
description: A lightweight UNIX(X) Process Pool implementation
|
31
31
|
email:
|
32
32
|
- rob@flowof.info
|
@@ -59,7 +59,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
59
59
|
version: '0'
|
60
60
|
segments:
|
61
61
|
- 0
|
62
|
-
hash:
|
62
|
+
hash: -2070941546545092687
|
63
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
64
|
none: false
|
65
65
|
requirements:
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
68
|
version: '0'
|
69
69
|
segments:
|
70
70
|
- 0
|
71
|
-
hash:
|
71
|
+
hash: -2070941546545092687
|
72
72
|
requirements: []
|
73
73
|
rubyforge_project:
|
74
74
|
rubygems_version: 1.8.23
|