Skip to content

Commit

Permalink
Replace Async::IO::Socket usage with stdlib Socket for async-http ada…
Browse files Browse the repository at this point in the history
…pter to remove implicit dependency on async-io
  • Loading branch information
jakeonfire committed Apr 26, 2024
1 parent fc6a2ab commit 39a4c5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/webmock/http_lib_adapters/async_http_client_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ def inspect

def create_connected_sockets
pair = begin
Async::IO::Socket.pair(Socket::AF_UNIX, Socket::SOCK_STREAM)
Socket.pair(Socket::AF_UNIX, Socket::SOCK_STREAM)
rescue Errno::EAFNOSUPPORT
Async::IO::Socket.pair(Socket::AF_INET, Socket::SOCK_STREAM)
Socket.pair(Socket::AF_INET, Socket::SOCK_STREAM)
end
pair.tap do |sockets|
sockets.each do |socket|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "ostruct"

module AsyncHttpClientSpecHelper
def http_request(method, url, options = {}, &block)
endpoint = Async::HTTP::Endpoint.parse(url)
Expand Down

0 comments on commit 39a4c5c

Please sign in to comment.