async-http 0.3.0 → 0.3.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
  SHA1:
3
- metadata.gz: 2f9b73efd52b9aff0ce5694485bdb8aac7cf1082
4
- data.tar.gz: f0634e36cc4197cec96f31cfd61e6b381ecf66bc
3
+ metadata.gz: 6fce38c1115bbe503e86d15b336e3349d5a488e6
4
+ data.tar.gz: fecedadf134b59bc647b7c13d95075ab00234b66
5
5
  SHA512:
6
- metadata.gz: aa06d63bf498e81afb71e35d20d2b3b9a7176a1f1ceaf2237bd6ad0172104b76fac30529ad1946c32504bb024ba86e88fa10e90f7b6edd01d391dbf305f47f9b
7
- data.tar.gz: 7d46145caa8a5460d6920103272569b82d415a9e570ed5c755b79c2fc00ecfd1c9ceb25b16f7fc6cbb4aa00422a61d136c4729ea2afa8414595e84b464f2d6dd
6
+ metadata.gz: 0026bd2859840401598ab851bc6d70a406b6ca6bf2e71d48b907e2cb52c09d140062d9aaf5d8e9ff6d1f22a290f261bace08755f810642777935761c06b086fa
7
+ data.tar.gz: 42ddeada51f20f98fd99de6d746305c7329bdbe1a951d76f7299df5e4aba613e4abf130f98f6d5a8d12d8a8ccdbb45390ba74f94025561336ef26a7b3320f63c
data/.travis.yml CHANGED
@@ -2,16 +2,18 @@ language: ruby
2
2
  sudo: false
3
3
  dist: trusty
4
4
  cache: bundler
5
- rvm:
6
- - 2.0
7
- - 2.1
8
- - 2.2
9
- - 2.3
10
- - 2.4
11
- - jruby-head
12
- - ruby-head
13
- - rbx-3
5
+
14
6
  matrix:
7
+ include:
8
+ - rvm: 2.0
9
+ - rvm: 2.1
10
+ - rvm: 2.2
11
+ - rvm: 2.3
12
+ - rvm: 2.4
13
+ - rvm: jruby-head
14
+ env: JRUBY_OPTS="--debug -X+O"
15
+ - rvm: ruby-head
16
+ - rvm: rbx-3
15
17
  allow_failures:
16
18
  - rvm: ruby-head
17
19
  - rvm: jruby-head
data/async-http.gemspec CHANGED
@@ -15,7 +15,8 @@ Gem::Specification.new do |spec|
15
15
  end
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", "~> 1.1")
19
20
  spec.add_dependency("async-io", "~> 1.0")
20
21
 
21
22
  spec.add_development_dependency "async-rspec", "~> 1.1"
@@ -52,13 +52,18 @@ module Async
52
52
  end
53
53
 
54
54
  # Server loop.
55
- def receive_requests
56
- while request = Request.new(*read_request)
55
+ def receive_requests(task: Task.current)
56
+ while true
57
+ request = Request.new(*read_request)
58
+
57
59
  status, headers, body = yield request
58
60
 
59
61
  write_response(request.version, status, headers, body)
60
62
 
61
63
  break unless keep_alive?(request.headers) && keep_alive?(headers)
64
+
65
+ # This ensures we yield at least once every iteration of the loop and allow other fibers to execute.
66
+ task.yield
62
67
  end
63
68
  end
64
69
 
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module HTTP
23
- VERSION = "0.3.0"
23
+ VERSION = "0.3.1"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.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: 2017-07-30 00:00:00.000000000 Z
11
+ date: 2017-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: async
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.1'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: async-io
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -124,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
138
  version: '0'
125
139
  requirements: []
126
140
  rubyforge_project:
127
- rubygems_version: 2.6.12
141
+ rubygems_version: 2.6.10
128
142
  signing_key:
129
143
  specification_version: 4
130
144
  summary: ''