e-threadpool 1.2.0 → 1.3.0

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.
Files changed (2) hide show
  1. data/lib/threadpool/core.rb +4 -4
  2. metadata +1 -1
@@ -31,7 +31,7 @@ module Ethreadpool
31
31
  worker = idle_worker
32
32
  worker.nil? ? create_worker : break
33
33
 
34
- # sleep here is a must, or MRI will get stucks
34
+ # sleep here is a must, or MRI will get stuck
35
35
  sleep(0.001)
36
36
  end
37
37
 
@@ -43,8 +43,8 @@ module Ethreadpool
43
43
  @checker_thread.join
44
44
  end
45
45
 
46
- def busy_workers_count
47
- busy_workers.count
46
+ def idle?
47
+ busy_workers.empty?
48
48
  end
49
49
 
50
50
  private
@@ -63,7 +63,7 @@ module Ethreadpool
63
63
  end
64
64
  sleep(0.001)
65
65
 
66
- if @teminate && busy_workers_count == 0
66
+ if @teminate && idle? == 0
67
67
  return
68
68
  end
69
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: e-threadpool
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: