async-http 0.2.1 → 0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9be0535f6b1fe7573ca409923d89338e0b024d2
4
- data.tar.gz: 6d2cdc0d28de05c3e78db9f4be5585a1e2a4861b
3
+ metadata.gz: 2f9b73efd52b9aff0ce5694485bdb8aac7cf1082
4
+ data.tar.gz: f0634e36cc4197cec96f31cfd61e6b381ecf66bc
5
5
  SHA512:
6
- metadata.gz: 076440e10a4aa34b45da40891ed7c58a63f4eeaca246894b6c186b1cd2da3e8d68366e485d31438289bfe46f855600079b4fb0258655f609f6b7834a7aaad741
7
- data.tar.gz: dde1b7737ad31b7b67803cc7703030aaccb8b3af12366f3dcdd3550c35eab0ccb60d4e9452f3b87db403826acc064358e7e3a5710ba4a0fdfc6f7f4abbc02261
6
+ metadata.gz: aa06d63bf498e81afb71e35d20d2b3b9a7176a1f1ceaf2237bd6ad0172104b76fac30529ad1946c32504bb024ba86e88fa10e90f7b6edd01d391dbf305f47f9b
7
+ data.tar.gz: 7d46145caa8a5460d6920103272569b82d415a9e570ed5c755b79c2fc00ecfd1c9ceb25b16f7fc6cbb4aa00422a61d136c4729ea2afa8414595e84b464f2d6dd
data/README.md CHANGED
@@ -37,7 +37,7 @@ require 'async/http/client'
37
37
  require 'async/reactor'
38
38
 
39
39
  server_addresses = [
40
- Async::IO::Address.tcp('127.0.0.1', 9294, reuse_port: true)
40
+ Async::IO::Endpoint.tcp('127.0.0.1', 9294, reuse_port: true)
41
41
  ]
42
42
 
43
43
  app = lambda do |env|
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ task :server do
14
14
  end
15
15
 
16
16
  server = Async::HTTP::Server.new([
17
- Async::IO::Address.tcp('127.0.0.1', 9294, reuse_port: true)
17
+ Async::IO::Endpoint.tcp('127.0.0.1', 9294, reuse_port: true)
18
18
  ], app)
19
19
 
20
20
  Async::Reactor.run do
@@ -27,7 +27,7 @@ task :client do
27
27
  require 'async/http/client'
28
28
 
29
29
  client = Async::HTTP::Client.new([
30
- Async::IO::Address.tcp('127.0.0.1', 9294, reuse_port: true)
30
+ Async::IO::Endpoint.tcp('127.0.0.1', 9294, reuse_port: true)
31
31
  ])
32
32
 
33
33
  Async::Reactor.run do
@@ -46,7 +46,7 @@ task :wrk do
46
46
  end
47
47
 
48
48
  server = Async::HTTP::Server.new([
49
- Async::IO::Address.tcp('127.0.0.1', 9294, reuse_port: true)
49
+ Async::IO::Endpoint.tcp('127.0.0.1', 9294, reuse_port: true)
50
50
  ], app)
51
51
 
52
52
  process_count = Etc.nprocessors
data/async-http.gemspec CHANGED
@@ -16,9 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
17
  spec.require_paths = ["lib"]
18
18
 
19
- spec.add_dependency("async-io", "~> 0.4")
20
-
21
- spec.add_dependency('samovar', "~> 1.3")
19
+ spec.add_dependency("async-io", "~> 1.0")
22
20
 
23
21
  spec.add_development_dependency "async-rspec", "~> 1.1"
24
22
 
@@ -18,15 +18,15 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
20
 
21
- require 'async/io/address'
21
+ require 'async/io/endpoint'
22
22
 
23
23
  require_relative 'protocol'
24
24
 
25
25
  module Async
26
26
  module HTTP
27
27
  class Client
28
- def initialize(addresses, protocol_class = Protocol::HTTP11)
29
- @addresses = addresses
28
+ def initialize(endpoints, protocol_class = Protocol::HTTP11)
29
+ @endpoints = endpoints
30
30
 
31
31
  @protocol_class = protocol_class
32
32
  end
@@ -42,10 +42,10 @@ module Async
42
42
  private
43
43
 
44
44
  def connect
45
- Async::IO::Address.each(@addresses) do |address|
45
+ Async::IO::Endpoint.each(@endpoints) do |endpoint|
46
46
  # puts "Connecting to #{address} on process #{Process.pid}"
47
47
 
48
- address.connect do |peer|
48
+ endpoint.connect do |peer|
49
49
  stream = Async::IO::Stream.new(peer)
50
50
 
51
51
  # We only yield for first successful connection.
@@ -18,15 +18,15 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
20
 
21
- require 'async/io/address'
21
+ require 'async/io/endpoint'
22
22
 
23
23
  require_relative 'protocol'
24
24
 
25
25
  module Async
26
26
  module HTTP
27
27
  class Server
28
- def initialize(addresses, protocol_class = Protocol::HTTP1x)
29
- @addresses = addresses
28
+ def initialize(endpoints, protocol_class = Protocol::HTTP1x)
29
+ @endpoints = endpoints
30
30
  @protocol_class = protocol_class
31
31
  end
32
32
 
@@ -59,10 +59,10 @@ module Async
59
59
  end
60
60
 
61
61
  def run
62
- Async::IO::Address.each(@addresses) do |address|
63
- # puts "Binding to #{address} on process #{Process.pid}"
62
+ Async::IO::Endpoint.each(@endpoints) do |endpoint|
63
+ # puts "Binding to #{endpoint} on process #{Process.pid}"
64
64
 
65
- address.accept(&self.method(:accept))
65
+ endpoint.accept(&self.method(:accept))
66
66
  end
67
67
  end
68
68
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module HTTP
23
- VERSION = "0.2.1"
23
+ VERSION = "0.3.0"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
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-07-05 00:00:00.000000000 Z
11
+ date: 2017-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-io
@@ -16,28 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.4'
19
+ version: '1.0'
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
- version: '0.4'
27
- - !ruby/object:Gem::Dependency
28
- name: samovar
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '1.3'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '1.3'
26
+ version: '1.0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: async-rspec
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -138,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
124
  version: '0'
139
125
  requirements: []
140
126
  rubyforge_project:
141
- rubygems_version: 2.6.10
127
+ rubygems_version: 2.6.12
142
128
  signing_key:
143
129
  specification_version: 4
144
130
  summary: ''