syntropy 0.44.0 → 0.45.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/syntropy/http/server_connection.rb +11 -0
- data/lib/syntropy/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: ead9689d0d95bfa7248afef03c9281451086131d05bdca203b068243c305f17d
|
|
4
|
+
data.tar.gz: 7014f5912cc8c42e23194e74dc076eba91a4a203e97316874af15206ca363462
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7a5af83c3785c590a8eb5f4a37e9c262b71d387dd229b635bd9f3d4b7a6aeb7a26e168cc4c945f2d4f79406724a876172101bb41fe1db226a15d0e17cd221d21
|
|
7
|
+
data.tar.gz: 0701b949f7e3c836ac188ac40357d7d24a4e5e694eed28df16313333b460b6be28e3ab310a0db17e9e76045de166da4dae143077befe69ee21a399143ea8889c
|
data/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,15 @@ module Syntropy
|
|
|
13
13
|
class ServerConnection
|
|
14
14
|
attr_reader :fd, :io, :response_headers, :logger
|
|
15
15
|
|
|
16
|
+
@@connection_count = 0
|
|
17
|
+
|
|
18
|
+
# Returns the number of current connections
|
|
19
|
+
#
|
|
20
|
+
# @return [Integer]
|
|
21
|
+
def self.count
|
|
22
|
+
@@connection_count
|
|
23
|
+
end
|
|
24
|
+
|
|
16
25
|
# Initializes a server connection.
|
|
17
26
|
#
|
|
18
27
|
# @param machine [UringMachine] machine instance
|
|
@@ -38,6 +47,7 @@ module Syntropy
|
|
|
38
47
|
#
|
|
39
48
|
# @return [void]
|
|
40
49
|
def run
|
|
50
|
+
@@connection_count += 1
|
|
41
51
|
loop do
|
|
42
52
|
persist = serve_request
|
|
43
53
|
break if !persist
|
|
@@ -54,6 +64,7 @@ module Syntropy
|
|
|
54
64
|
error: e
|
|
55
65
|
)
|
|
56
66
|
ensure
|
|
67
|
+
@@connection_count -= 1
|
|
57
68
|
@io.clear
|
|
58
69
|
@machine.close_async(@fd)
|
|
59
70
|
end
|
data/lib/syntropy/version.rb
CHANGED