Skip to content

Commit 9d5e141

Browse files
committed
Update dependency on protocol-http2.
1 parent b1d4daf commit 9d5e141

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

async-http.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ Gem::Specification.new do |spec|
2929
spec.add_dependency "async-pool", ">= 0.6.1"
3030
spec.add_dependency "protocol-http", "~> 0.26.0"
3131
spec.add_dependency "protocol-http1", "~> 0.19.0"
32-
spec.add_dependency "protocol-http2", "~> 0.16.0"
32+
spec.add_dependency "protocol-http2", "~> 0.17.0"
3333
spec.add_dependency "traces", ">= 0.10.0"
3434
end

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

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ def initialize(*)
3535
@write_frame_guard = Async::Semaphore.new(1)
3636
end
3737

38+
def synchronize(&block)
39+
@write_frame_guard.acquire(&block)
40+
end
41+
3842
def to_s
3943
"\#<#{self.class} #{@count} requests, #{@streams.count} active streams>"
4044
end
@@ -72,23 +76,6 @@ def close(error = nil)
7276
end
7377
end
7478

75-
def write_frame(frame)
76-
# We don't want to write multiple frames at the same time.
77-
@write_frame_guard.acquire do
78-
super
79-
end
80-
81-
@stream.flush
82-
end
83-
84-
def write_frames(&block)
85-
@write_frame_guard.acquire do
86-
super
87-
end
88-
89-
@stream.flush
90-
end
91-
9279
def read_in_background(parent: Task.current)
9380
raise RuntimeError, "Connection is closed!" if closed?
9481

0 commit comments

Comments
 (0)