async-container 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9a545d6e534a06578b5a79cdda51e266c8f2757d
4
- data.tar.gz: b2b7227a1597f3f877d6a94058419c7ebca517e4
2
+ SHA256:
3
+ metadata.gz: 9ebb8de7090ed5a5d23691d8571baeb429b48a9f074732c236224e070beb494c
4
+ data.tar.gz: 3146ab6d57971fd5ac44649c866e9cdaade193d42281e1cdd6c2bfc4b95b134a
5
5
  SHA512:
6
- metadata.gz: 464481abc1e5ab4ee1db48dce359719d5aa7b2b6c8462ec20876c291ca2121efa5157fc8645500016c4dcde7c78437477219b3965683400e5008017fe50bec46
7
- data.tar.gz: 2a533fa0a81fe738f471e6e4cf0dc27da075eb2c0c4a70bfd0454d2e3ad1bde82498fe1d5fb312822aa58a3821a3ce6f69c1b3f837c8d2c4d313904dfbdeea75
6
+ metadata.gz: 325838cec3b84c9d3f90f4d79dd7fb927275edbd547f9205bac7e31c8dd0e02aaf7c7030d82223f2c05a6b3ee2ef1e889b824640f8e81f8c9f307b40d751e12b
7
+ data.tar.gz: 7ffee495a8907695266b22696a8ecece4a2beb73b5ba392ad37332b1671bbb6ab6d063aec96ce4410524c2afef8dec0f66ea141a8bdcbcd64ee4cb24340fffe3
@@ -20,11 +20,19 @@
20
20
 
21
21
  require_relative 'container/threaded'
22
22
 
23
+ require 'etc'
24
+
23
25
  module Async
24
26
  # Manages a reactor within one or more threads.
25
27
  module Container
26
28
  def self.new(**options, &block)
27
29
  Threaded.new(**options, &block)
28
30
  end
31
+
32
+ def self.hardware_concurrency
33
+ Etc.nprocessors
34
+ rescue
35
+ 2
36
+ end
29
37
  end
30
38
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module Container
23
- VERSION = "0.2.2"
23
+ VERSION = "0.3.0"
24
24
  end
25
25
  end
@@ -32,4 +32,8 @@ RSpec.describe Async::Container do
32
32
 
33
33
  expect(count).to be == 1
34
34
  end
35
+
36
+ it "can get hardware concurrency" do
37
+ expect(Async::Container.hardware_concurrency).to be >= 1
38
+ end
35
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-container
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-10 00:00:00.000000000 Z
11
+ date: 2018-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.6.14
127
+ rubygems_version: 2.7.6
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Async is an asynchronous I/O framework based on nio4r.