parallel 1.26.1 → 1.26.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parallel/version.rb +1 -1
- data/lib/parallel.rb +11 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c07164b3539800c522450fc924698e6cf1b81b70f7d9d60af4610336eba30dbd
|
4
|
+
data.tar.gz: f88c4de5c97837809bc5c120da1ada9a30b06131bff9fab60e5de42c0c0f7747
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ae2b910a41386edcace4a457a23fb2db78bd724634063cdc81e600c07342d7bff03415d5829fb7639834c7353edeb2b1c46f6a95e758f8634cf1f510c5ec117
|
7
|
+
data.tar.gz: e8c800d89d83c15ef86a2bac9bc1bb7875df1466a208b357a792ddb786d9f2758a7b2a4c75b071f18f1f1f39b1eda9ddaccf11f3a929d296b5c13677276dee11
|
data/lib/parallel/version.rb
CHANGED
data/lib/parallel.rb
CHANGED
@@ -337,10 +337,10 @@ module Parallel
|
|
337
337
|
end
|
338
338
|
end
|
339
339
|
|
340
|
-
# Number of processors seen by the OS
|
340
|
+
# Number of processors seen by the OS or value considering CPU quota if the process is inside a cgroup,
|
341
|
+
# used for process scheduling
|
341
342
|
def processor_count
|
342
|
-
|
343
|
-
@processor_count ||= Integer(ENV['PARALLEL_PROCESSOR_COUNT'] || Etc.nprocessors)
|
343
|
+
@processor_count ||= Integer(ENV['PARALLEL_PROCESSOR_COUNT'] || available_processor_count)
|
344
344
|
end
|
345
345
|
|
346
346
|
def worker_number
|
@@ -695,5 +695,13 @@ module Parallel
|
|
695
695
|
return unless (on_start = options[:start])
|
696
696
|
options[:mutex].synchronize { on_start.call(item, index) }
|
697
697
|
end
|
698
|
+
|
699
|
+
def available_processor_count
|
700
|
+
require 'concurrent-ruby'
|
701
|
+
Concurrent.available_processor_count.floor
|
702
|
+
rescue LoadError, NoMethodError
|
703
|
+
require 'etc'
|
704
|
+
Etc.nprocessors
|
705
|
+
end
|
698
706
|
end
|
699
707
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.26.
|
4
|
+
version: 1.26.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: michael@grosser.it
|
@@ -24,8 +24,8 @@ licenses:
|
|
24
24
|
- MIT
|
25
25
|
metadata:
|
26
26
|
bug_tracker_uri: https://github.com/grosser/parallel/issues
|
27
|
-
documentation_uri: https://github.com/grosser/parallel/blob/v1.26.
|
28
|
-
source_code_uri: https://github.com/grosser/parallel/tree/v1.26.
|
27
|
+
documentation_uri: https://github.com/grosser/parallel/blob/v1.26.2/Readme.md
|
28
|
+
source_code_uri: https://github.com/grosser/parallel/tree/v1.26.2
|
29
29
|
wiki_uri: https://github.com/grosser/parallel/wiki
|
30
30
|
post_install_message:
|
31
31
|
rdoc_options: []
|