Go.rb 0.1.2 → 0.1.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.
- checksums.yaml +4 -4
- data/Rakefile +2 -0
- data/goruby.gemspec +2 -0
- data/lib/go.rb +1 -4
- data/lib/go/concurrency/future.rb +1 -1
- data/lib/go/concurrency/pool.rb +2 -2
- data/lib/go/engine.rb +17 -0
- data/lib/go/goconfig.rb +5 -5
- data/lib/go/version.rb +1 -1
- metadata +31 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15835470aa1c2184c9588f685b18ebbb35924a3f
|
4
|
+
data.tar.gz: 28007c58af472a54ade8bf74bd30cb7878350174
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce83cb8fd25c08e409580ac62375975c981981f538974e596fce73b5495063873b9fe264b9bbab5f59ae9965ead065eec5fc62f28c7ba043701efb6b1abffb34
|
7
|
+
data.tar.gz: b8459c81e1b6ea35fa9ae1ee8266d7c1b6d937106fa271135d5c96b4f5eefa0fda47022bf5a216993159463915ab8bef42a3aafbe229bdbae57ca829f300e8d1
|
data/Rakefile
CHANGED
data/goruby.gemspec
CHANGED
data/lib/go.rb
CHANGED
data/lib/go/concurrency/pool.rb
CHANGED
@@ -11,7 +11,6 @@ module Go
|
|
11
11
|
@growing = growing
|
12
12
|
@workQueue = Queue.new
|
13
13
|
@running = true
|
14
|
-
@shutting_down = false
|
15
14
|
|
16
15
|
initStatic() unless @growing
|
17
16
|
end
|
@@ -37,7 +36,7 @@ module Go
|
|
37
36
|
end
|
38
37
|
|
39
38
|
def execute(&block)
|
40
|
-
execute_proc(
|
39
|
+
return execute_proc(block)
|
41
40
|
end
|
42
41
|
|
43
42
|
def execute_proc(proc)
|
@@ -62,6 +61,7 @@ module Go
|
|
62
61
|
|
63
62
|
def shutdown
|
64
63
|
@running = false
|
64
|
+
@threads.each { |t| t.kill }
|
65
65
|
end
|
66
66
|
|
67
67
|
def max; @max end
|
data/lib/go/engine.rb
ADDED
data/lib/go/goconfig.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
module Go
|
2
2
|
class Config
|
3
3
|
|
4
|
-
def initialize(max_threads)
|
4
|
+
def initialize(max_threads, growing = true)
|
5
5
|
@threads = max_threads
|
6
|
-
@pool = Go::CC::ThreadPool.new(max_threads)
|
6
|
+
@pool = Go::CC::ThreadPool.new(max_threads, growing)
|
7
7
|
end
|
8
8
|
|
9
|
-
def
|
9
|
+
def max_thread_count
|
10
10
|
@threads
|
11
11
|
end
|
12
12
|
|
@@ -14,8 +14,8 @@ module Go
|
|
14
14
|
@pool
|
15
15
|
end
|
16
16
|
|
17
|
-
def self.create(max_threads = 10)
|
18
|
-
@@config = Config.new(max_threads)
|
17
|
+
def self.create(max_threads = 10, growing = true)
|
18
|
+
@@config = Config.new(max_threads, growing)
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.maybe_create(max_threads = 10)
|
data/lib/go/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Go.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JacisNonsense
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,34 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: test-unit
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: coveralls
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
41
69
|
description: "'Go' is a language that specializes in concurrency and control flow,
|
42
70
|
but some people (myself included) don't like the choice of Syntax. Not only that,
|
43
71
|
but these features are something that could be useful in other projects, hence why
|
@@ -55,6 +83,7 @@ files:
|
|
55
83
|
- lib/go.rb
|
56
84
|
- lib/go/concurrency/future.rb
|
57
85
|
- lib/go/concurrency/pool.rb
|
86
|
+
- lib/go/engine.rb
|
58
87
|
- lib/go/goconfig.rb
|
59
88
|
- lib/go/kernel.rb
|
60
89
|
- lib/go/version.rb
|