celluloid-pmap 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/celluloid-pmap.gemspec +1 -1
- data/lib/celluloid/pmap.rb +13 -2
- data/lib/celluloid/pmap/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87801c95ee0b65e7efad886c800f8e0c5ce4cb15
|
4
|
+
data.tar.gz: 83e083290f31ddb16d8e0f3ee7098d44700b1de6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8931423cd0d9e6f03bf86aa2163f1162f82a33a41e3d8bc8f60af1906429b8d75523ee59082099c294b8f8e45c4e45d89689a899ef3eef37911bb46ee5a6577
|
7
|
+
data.tar.gz: 73b1e7e226d57b2a35a4d48977bc15b9b483c9ec332c6e2adbab38fa5409f9c1fbb5386fcb7b6c07d2c2658b6586378a8901ae0870a714a9bd13e742ec50adc1
|
data/README.md
CHANGED
data/celluloid-pmap.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
|
-
gem.add_dependency('celluloid', '
|
21
|
+
gem.add_dependency('celluloid', ' >= 0.16')
|
22
22
|
|
23
23
|
gem.add_development_dependency "rake"
|
24
24
|
gem.add_development_dependency "rspec", "2.99"
|
data/lib/celluloid/pmap.rb
CHANGED
@@ -1,15 +1,26 @@
|
|
1
|
-
require 'celluloid'
|
2
1
|
require 'celluloid/pmap/parallel_map_worker'
|
3
2
|
require "celluloid/pmap/version"
|
4
3
|
|
5
4
|
module Celluloid
|
6
5
|
module Pmap
|
7
6
|
|
7
|
+
|
8
|
+
def self.pool_class
|
9
|
+
celluloid_version = Celluloid::VERSION.to_s.split('.')
|
10
|
+
if celluloid_version[0].to_i >= 0 && celluloid_version[1].to_i <= 16
|
11
|
+
require 'celluloid'
|
12
|
+
Celluloid::PoolManager
|
13
|
+
else
|
14
|
+
require 'celluloid/current'
|
15
|
+
Celluloid::Supervision::Container::Pool
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
8
19
|
def self.included(base)
|
9
20
|
base.class_eval do
|
10
21
|
|
11
22
|
def pmap(pool_or_size=Celluloid.cores, &block)
|
12
|
-
pool = if pool_or_size.class.ancestors.include?(Celluloid::
|
23
|
+
pool = if pool_or_size.class.ancestors.include?(Celluloid::Pmap.pool_class)
|
13
24
|
pool_or_size
|
14
25
|
else
|
15
26
|
Pmap::ParallelMapWorker.pool(size: pool_or_size)
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: celluloid-pmap
|
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
|
- Jesse Wolgamott
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.16'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.16'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -118,3 +118,4 @@ test_files:
|
|
118
118
|
- spec/celluloid/pmap_spec.rb
|
119
119
|
- spec/spec_helper.rb
|
120
120
|
- spec/support/benchmark_spec.rb
|
121
|
+
has_rdoc:
|