ActionPool 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/Rakefile +74 -0
- data/actionpool.gemspec +1 -1
- data/lib/actionpool/Pool.rb +3 -1
- metadata +16 -18
- data/ActionPool-0.0.1.gem +0 -0
- data/ActionPool-0.1.0.gem +0 -0
- data/ActionPool-0.2.0.gem +0 -0
data/CHANGELOG
CHANGED
data/Rakefile
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |s|
|
7
|
+
s.name = 'ActionPool'
|
8
|
+
s.author = %q(spox)
|
9
|
+
s.email = %q(spox@modspox.com)
|
10
|
+
s.version = '0.0.1'
|
11
|
+
s.summary = %q(Thread Pooling Library)
|
12
|
+
s.platform = Gem::Platform::RUBY
|
13
|
+
s.files = Dir['**/*']
|
14
|
+
s.rdoc_options = %w(--title ActionPool --main README.rdoc --line-numbers)
|
15
|
+
s.extra_rdoc_files = %w(README.rdoc)
|
16
|
+
s.require_paths = %w(lib)
|
17
|
+
s.required_ruby_version = '>= 1.8.6'
|
18
|
+
s.rubyforge_project = 'ActionPool'
|
19
|
+
s.add_development_dependency 'thoughtbot-shoulda'
|
20
|
+
s.homepage = %q(http://dev.modspox.com/trac/ActionPool)
|
21
|
+
description = []
|
22
|
+
File.open("README.rdoc") do |file|
|
23
|
+
file.each do |line|
|
24
|
+
line.chomp!
|
25
|
+
break if line.empty?
|
26
|
+
description << "#{line.gsub(/\[\d\]/, '')}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
s.description = description[1..-1].join(" ")
|
30
|
+
end
|
31
|
+
Jeweler::RubyforgeTasks.new do |rubyforge|
|
32
|
+
rubyforge.doc_task = 'rdoc'
|
33
|
+
end
|
34
|
+
rescue LoadError
|
35
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
36
|
+
end
|
37
|
+
|
38
|
+
require 'rake/testtask'
|
39
|
+
Rake::TestTask.new(:test) do |test|
|
40
|
+
test.libs << 'lib' << 'test'
|
41
|
+
test.pattern = 'test/**/*_test.rb'
|
42
|
+
test.verbose = true
|
43
|
+
end
|
44
|
+
|
45
|
+
begin
|
46
|
+
require 'rcov/rcovtask'
|
47
|
+
Rcov::RcovTask.new do |test|
|
48
|
+
test.libs << 'test'
|
49
|
+
test.pattern = 'test/**/*_test.rb'
|
50
|
+
test.verbose = true
|
51
|
+
end
|
52
|
+
rescue LoadError
|
53
|
+
task :rcov do
|
54
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
task :test => :check_dependencies
|
59
|
+
|
60
|
+
task :default => :test
|
61
|
+
|
62
|
+
require 'rake/rdoctask'
|
63
|
+
Rake::RDocTask.new do |rdoc|
|
64
|
+
if File.exist?('VERSION')
|
65
|
+
version = File.read('VERSION')
|
66
|
+
else
|
67
|
+
version = ""
|
68
|
+
end
|
69
|
+
|
70
|
+
rdoc.rdoc_dir = 'rdoc'
|
71
|
+
rdoc.title = "test_repo #{version}"
|
72
|
+
rdoc.rdoc_files.include('README*')
|
73
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
74
|
+
end
|
data/actionpool.gemspec
CHANGED
data/lib/actionpool/Pool.rb
CHANGED
@@ -20,8 +20,9 @@ module ActionPool
|
|
20
20
|
@lock = Mutex.new
|
21
21
|
@thread_timeout = args[:t_to] ? args[:t_to] : 0
|
22
22
|
@action_timeout = args[:a_to] ? args[:a_to] : 0
|
23
|
-
@min_threads = args[:min_threads] ? args[:min_threads] : 10
|
24
23
|
@max_threads = args[:max_threads] ? args[:max_threads] : 100
|
24
|
+
@min_threads = args[:min_threads] ? args[:min_threads] : 10
|
25
|
+
@min_threads = @max_threads if @max_threads < @min_threads
|
25
26
|
@respond_to = ::Thread.current
|
26
27
|
create_thread
|
27
28
|
end
|
@@ -134,6 +135,7 @@ module ActionPool
|
|
134
135
|
m = m.to_i
|
135
136
|
raise ArgumentError.new('Maximum value must be greater than 0') unless m > 0
|
136
137
|
@max_threads = m
|
138
|
+
@min_threads = m if m < @min_threads
|
137
139
|
resize if m < size
|
138
140
|
m
|
139
141
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ActionPool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- spox
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-11-04 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -23,31 +23,29 @@ extra_rdoc_files:
|
|
23
23
|
- README.rdoc
|
24
24
|
- CHANGELOG
|
25
25
|
files:
|
26
|
-
-
|
27
|
-
-
|
28
|
-
- lib/actionpool/LogHelper.rb
|
29
|
-
- lib/actionpool/Pool.rb
|
30
|
-
- lib/actionpool/Thread.rb
|
31
|
-
- lib/actionpool/Queue.rb
|
32
|
-
- lib/actionpool.rb
|
33
|
-
- ActionPool-0.2.0.gem
|
26
|
+
- Rakefile
|
27
|
+
- actionpool.gemspec
|
34
28
|
- tests
|
35
29
|
- tests/cases
|
36
|
-
- tests/cases/shutdown.rb
|
37
|
-
- tests/cases/nogrow.rb
|
38
30
|
- tests/cases/general.rb
|
39
|
-
- tests/cases/thread.rb
|
40
|
-
- tests/cases/grow.rb
|
41
|
-
- tests/cases/timeouts.rb
|
42
31
|
- tests/cases/resize.rb
|
32
|
+
- tests/cases/nogrow.rb
|
33
|
+
- tests/cases/timeouts.rb
|
34
|
+
- tests/cases/thread.rb
|
35
|
+
- tests/cases/shutdown.rb
|
43
36
|
- tests/cases/queue.rb
|
37
|
+
- tests/cases/grow.rb
|
44
38
|
- tests/run_tests.rb
|
39
|
+
- lib
|
40
|
+
- lib/actionpool
|
41
|
+
- lib/actionpool/Pool.rb
|
42
|
+
- lib/actionpool/Thread.rb
|
43
|
+
- lib/actionpool/LogHelper.rb
|
44
|
+
- lib/actionpool/Queue.rb
|
45
|
+
- lib/actionpool.rb
|
45
46
|
- CHANGELOG
|
46
|
-
- ActionPool-0.1.0.gem
|
47
47
|
- LICENSE
|
48
48
|
- README.rdoc
|
49
|
-
- ActionPool-0.0.1.gem
|
50
|
-
- actionpool.gemspec
|
51
49
|
has_rdoc: false
|
52
50
|
homepage: http://github.com/spox/actionpool
|
53
51
|
post_install_message:
|
data/ActionPool-0.0.1.gem
DELETED
Binary file
|
data/ActionPool-0.1.0.gem
DELETED
Binary file
|
data/ActionPool-0.2.0.gem
DELETED
File without changes
|