mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-21 13:46:30 +09:00
Open pooled push connections as a Net::HTTP subclass that includes Stages
WebPush::Connections mixed Stages into each new connection with `http.extend Stages` just before starting it. The connection is built in one place, WebPush::PersistentRequest, so it can be built from a class that already includes Stages: the same method lookup, without giving every pooled connection its own singleton class. Connections#request now also refuses a connection that isn't one, so a caller that builds a plain Net::HTTP gets the ArgumentError rather than a connection whose failures can't be told apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2d4b05a74a
commit
2daa01e26b
3 files changed
+9
-4
No files matched your search
@@ -109,7 +109,7 @@ module PushServiceTestHelper
|
||||
|
||||
# Built as WebPush::PersistentRequest builds it for a delivery.
|
||||
def pinned_connection(server, ip = IP)
|
||||
Net::HTTP.new(HOST, server.port, nil).tap do |http|
|
||||
WebPush::Connections::HTTP.new(HOST, server.port, nil).tap do |http|
|
||||
http.ipaddr = ip
|
||||
http.use_ssl = true
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user