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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 277eab69875c267230dd9c936c17d0bfcb4ee53a3b8baa5a3bea632a8a1517d4
4
- data.tar.gz: 753ca178d4d5be205ee2d71ee08509b1f8745db80bba1b23785e08a0c7608265
3
+ metadata.gz: ead9689d0d95bfa7248afef03c9281451086131d05bdca203b068243c305f17d
4
+ data.tar.gz: 7014f5912cc8c42e23194e74dc076eba91a4a203e97316874af15206ca363462
5
5
  SHA512:
6
- metadata.gz: f80177d7e93d797a0ef12644e62265b198275ceac4c0621dc10ab692806bb0f98eb99c4082c84fcada831deaee27d86b1fe9323228fa745b609e4ad18ba94987
7
- data.tar.gz: 296a00998843af0e1a900ff51419613c6fdb6b4e68c0cd6e14d557ed04c9598e5826c50925954b65d56e8353efdfeb3fb7cea87406d4fe76f829ea092ef47f1b
6
+ metadata.gz: 7a5af83c3785c590a8eb5f4a37e9c262b71d387dd229b635bd9f3d4b7a6aeb7a26e168cc4c945f2d4f79406724a876172101bb41fe1db226a15d0e17cd221d21
7
+ data.tar.gz: 0701b949f7e3c836ac188ac40357d7d24a4e5e694eed28df16313333b460b6be28e3ab310a0db17e9e76045de166da4dae143077befe69ee21a399143ea8889c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.45.0 2026-11-08
2
+
3
+ - Add `ServerConnection.count` method
4
+
1
5
  # 0.44.0 2026-11-05
2
6
 
3
7
  - Rename `Request#json_pretty_response` to `Request#respond_json_pretty`
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Syntropy
4
- VERSION = '0.44.0'
4
+ VERSION = '0.45.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syntropy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.44.0
4
+ version: 0.45.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner