Skip to content

Commit 02464cf

Browse files
committed
Remove count, it's not particularly useful.
1 parent 5bded8a commit 02464cf

File tree

4 files changed

+2
-7
lines changed

4 files changed

+2
-7
lines changed

lib/async/http/protocol/http2/client.rb

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ def create_response
3232
def call(request)
3333
raise ::Protocol::HTTP2::Error, "Connection closed!" if self.closed?
3434

35-
@count += 1
36-
3735
response = create_response
3836
write_request(response, request)
3937
read_response(response)

lib/async/http/protocol/http2/connection.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ module Connection
2929
def initialize(*)
3030
super
3131

32-
@count = 0
3332
@reader = nil
3433

3534
# Writing multiple frames at the same time can cause odd problems if frames are only partially written. So we use a semaphore to ensure frames are written in their entirety.
@@ -41,7 +40,7 @@ def synchronize(&block)
4140
end
4241

4342
def to_s
44-
"\#<#{self.class} #{@count} requests, #{@streams.count} active streams>"
43+
"\#<#{self.class} #{@streams.count} active streams>"
4544
end
4645

4746
def as_json(...)

lib/async/http/protocol/http2/server.rb

-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ def each(task: Task.current)
5151
@requests&.async do |task, request|
5252
task.annotate("Incoming request: #{request.method} #{request.path.inspect}.")
5353

54-
@count += 1
55-
5654
task.defer_stop do
5755
response = yield(request)
5856
rescue

test/async/http/protocol/http2.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
response = client.get("/")
1818
connection = response.connection
1919

20-
expect(connection.as_json).to be =~ /#<Async::HTTP::Protocol::HTTP2::Client 1 requests, \d+ active streams>/
20+
expect(connection.as_json).to be =~ /#<Async::HTTP::Protocol::HTTP2::Client \d+ active streams>/
2121
ensure
2222
response&.close
2323
end

0 commit comments

Comments
 (0)