async-http 0.27.6 → 0.27.7

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: '04804a551a037e5843feb5bb4f90f1894adf06b9f962e82aba11922ff4e31fe8'
4
- data.tar.gz: 43d4433a0f3ca5bc621e8af54d4679022abf89475016d08a12d7db878781c6f7
3
+ metadata.gz: 1a30b3776d7094afe5386fa1097e376bb0ba41596917f51a924e79e91531b6ae
4
+ data.tar.gz: 8ae1a4833d716423edcd207f61d44338c8f6da9919b2a3ec70db559f206f6c30
5
5
  SHA512:
6
- metadata.gz: cf2278a356aeb0dadf8c3acec77ef21f50c91fdad4a43adcda743098cf68f550d460d7096b32d001898919520e58923bbb7ab5d3c428c838869fd0bd41bd4be3
7
- data.tar.gz: c78ffd154a4b249ee068c7988c97446670c2d17e24470b4b9f95ceef83179ff590773950c9a69766e619717810d3f6d7b421e34eff1a0c6913ba4ac2876e0275
6
+ metadata.gz: 5524c922e52a30bec82c9f686e0ade382d2ecb23b7a41e2cb2df7639458152bb7019dcae05c351fc34698ffdb9e8fa0b5a2d437a4cc1e28df411610c45189d81
7
+ data.tar.gz: 2d7615f6c95399630973aeff09744ba1153b3eef5916f64b4561868a2639ac9f946487aa66e7f851534643c5a40418eebe116ce1996d3824b9b82a480eb7c877
@@ -83,7 +83,7 @@ module Async
83
83
  return response
84
84
  rescue Protocol::RequestFailed
85
85
  # This is a specific case where the entire request wasn't sent before a failure occurred. So, we can even resend non-idempotent requests.
86
- @pool.release(connection)
86
+ @pool.release(connection) if connection
87
87
 
88
88
  attempt += 1
89
89
  if attempt < @retries
@@ -92,7 +92,7 @@ module Async
92
92
  raise
93
93
  end
94
94
  rescue
95
- @pool.release(connection)
95
+ @pool.release(connection) if connection
96
96
 
97
97
  if request.idempotent? and attempt < @retries
98
98
  retry
@@ -98,6 +98,7 @@ module Async
98
98
  end
99
99
 
100
100
  def wait_for_next_available
101
+ # If we fail to create a resource (below), we will end up waiting for one to become available.
101
102
  until resource = next_available
102
103
  @waiting << Fiber.current
103
104
  Task.yield
@@ -107,16 +108,11 @@ module Async
107
108
  end
108
109
 
109
110
  def create
110
- begin
111
- # This might fail, which is okay :)
112
- resource = @constructor.call
113
- rescue
114
- Async.logger.error "#{$!}: #{$!.backtrace}"
115
- return nil
111
+ # This might return nil, which means creating the resource failed.
112
+ if resource = @constructor.call
113
+ @available[resource] = 1
116
114
  end
117
115
 
118
- @available[resource] = 1
119
-
120
116
  return resource
121
117
  end
122
118
 
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module HTTP
23
- VERSION = "0.27.6"
23
+ VERSION = "0.27.7"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.6
4
+ version: 0.27.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams