async-http 0.27.0 → 0.27.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async/http/statistics.rb +6 -4
- data/lib/async/http/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29e7c425f733a4ca0835844e9348f012847766a876edaeda46bb6cda9bcb75e3
|
4
|
+
data.tar.gz: 988f79cdd1b7b30c9864f1d7f41a393fc19e6ddbcec4cc66bdd4273ac288c1db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a663c0840a0af98cba9fb9f50cbcd912255c0b1674a0d1ba576594f9a0c728a4d78ee435df8badc800253991cd66119f6b5c142c90de76408811e56661be91f
|
7
|
+
data.tar.gz: 3fc0c94c16edfd99a31b120757bd5e8f67d9d7ef5a2902ef07e3649af2e5e28e394d589f3ce1d6d39cefa7019b40c549c86a2f5dc26c6e212ebb91b5f8f91462
|
@@ -37,6 +37,8 @@ module Async
|
|
37
37
|
if response and response.body
|
38
38
|
response.body = Body::Statistics.new(@start_time, response.body, block)
|
39
39
|
end
|
40
|
+
|
41
|
+
return response
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
@@ -46,7 +48,7 @@ module Async
|
|
46
48
|
def initialize(start_time, body, callback)
|
47
49
|
super(body)
|
48
50
|
|
49
|
-
@
|
51
|
+
@sent = 0
|
50
52
|
|
51
53
|
@start_time = start_time
|
52
54
|
@first_chunk_time = nil
|
@@ -59,7 +61,7 @@ module Async
|
|
59
61
|
attr :first_chunk_time
|
60
62
|
attr :end_time
|
61
63
|
|
62
|
-
attr :
|
64
|
+
attr :sent
|
63
65
|
|
64
66
|
def total_duration
|
65
67
|
if @end_time
|
@@ -85,7 +87,7 @@ module Async
|
|
85
87
|
@first_chunk_time ||= Clock.now
|
86
88
|
|
87
89
|
if chunk
|
88
|
-
@
|
90
|
+
@sent += chunk.length
|
89
91
|
else
|
90
92
|
complete_statistics
|
91
93
|
end
|
@@ -94,7 +96,7 @@ module Async
|
|
94
96
|
end
|
95
97
|
|
96
98
|
def to_s
|
97
|
-
parts = ["sent #{@
|
99
|
+
parts = ["sent #{@sent} bytes"]
|
98
100
|
|
99
101
|
if duration = self.total_duration
|
100
102
|
parts << "took #{format_duration(duration)} in total"
|
data/lib/async/http/version.rb
CHANGED