async-http 0.24.0 → 0.24.1

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
2
  SHA256:
3
- metadata.gz: 2e35c6673eda6e9dd937957b447502b7d6ad4e715508185ead1d9ef2f03db7b3
4
- data.tar.gz: 597da90259cdb9611a5b70701d6eefc2ede3deaee51f905bdbbc78cd14feffd8
3
+ metadata.gz: c5a6e99912be72d417e22040dae54a5a71df384f1e49175397f54d79646e5693
4
+ data.tar.gz: 9799c54a6ee30585cbfe1f6bd5c405daf5e9b07087f450173043e7bcd12e8ef7
5
5
  SHA512:
6
- metadata.gz: 03ab49f9a1363ca6b2ee627a4ea437ead245103f7d6ec0feec290ea25a3ef7601f5afa19417c8fe0656c9b4bdde89868d051babec2234c35c1908ebacf41ccb6
7
- data.tar.gz: a7e24ce9ba42e98bd8ebcfeaf043a1b7e3748b8e50400365a8a1ec6214dc20f33b46ad553e3156bb320fa376d0fb1c0a030d50b7fbee3bc4ef69187f01af8dab
6
+ metadata.gz: ffd4ab0414e6f53b54af56c9cddcb91e223cb0608103db87f912c446c21ac64b9d770dd54e857ee9121ddfe72aa941d3b41df116229857f2a10ddbc90c598bca
7
+ data.tar.gz: '0622083f714c342a79d56a0f800e8b2eb92390b1f120f582e4c06ee2ca593828408a157c8d412c4a21ccdde5460642422cc9145b06e490dedea2f37b223829ca'
data/Rakefile CHANGED
@@ -6,8 +6,9 @@ RSpec::Core::RakeTask.new(:test)
6
6
  task :default => :test
7
7
 
8
8
  require 'async/http/protocol'
9
+ require 'async/io/host_endpoint'
9
10
 
10
- PROTOCOL = Async::HTTP::Protocol::HTTP2
11
+ PROTOCOL = Async::HTTP::Protocol::HTTP1
11
12
 
12
13
  task :debug do
13
14
  require 'async/logger'
@@ -17,13 +18,24 @@ end
17
18
 
18
19
  task :server do
19
20
  require 'async/reactor'
21
+ require 'async/container/forked'
20
22
  require 'async/http/server'
21
23
 
22
- server = Async::HTTP::Server.new(Async::IO::Endpoint.tcp('0.0.0.0', 9294, reuse_port: true), PROTOCOL)
24
+ server = Async::HTTP::Server.new(Async::IO::Endpoint.tcp('127.0.0.1', 9294, reuse_port: true), PROTOCOL) do |request, peer, address|
25
+ return Async::HTTP::Response[200, {'content-type' => 'text/plain'}, ["Hello World"]]
26
+ end
23
27
 
24
- Async::Reactor.run do
28
+ container = Async::Container::Forked.new(concurrency: 1) do
29
+ #GC.disable
30
+
25
31
  server.run
26
32
  end
33
+
34
+ container.wait
35
+ end
36
+
37
+ task :benchmark do
38
+ sh 'wrk -t 8 -c 8 -d 2 http://127.0.0.1:9294'
27
39
  end
28
40
 
29
41
  task :client do
data/async-http.gemspec CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
23
23
  # spec.add_dependency("openssl")
24
24
 
25
25
  spec.add_development_dependency "async-rspec", "~> 1.1"
26
+ spec.add_development_dependency "async-container", "~> 0.5.0"
26
27
 
27
28
  spec.add_development_dependency "bundler", "~> 1.3"
28
29
  spec.add_development_dependency "rspec", "~> 3.6"
data/lib/async/http.rb CHANGED
@@ -18,4 +18,9 @@
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/http/version"
21
+ require_relative 'http/version'
22
+
23
+ require_relative 'http/client'
24
+ require_relative 'http/server'
25
+
26
+ require_relative 'http/url_endpoint'
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module HTTP
23
- VERSION = "0.24.0"
23
+ VERSION = "0.24.1"
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.24.0
4
+ version: 0.24.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-03 00:00:00.000000000 Z
11
+ date: 2018-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: async-container
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.5.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.5.0
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: bundler
71
85
  requirement: !ruby/object:Gem::Requirement