Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/async/redis/endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require "io/endpoint"
require "io/endpoint/host_endpoint"
require "io/endpoint/ssl_endpoint"
require "io/endpoint/unix_endpoint"

require_relative "protocol/resp2"
require_relative "protocol/authenticated"
Expand Down Expand Up @@ -40,6 +41,11 @@ def self.remote(host, port = 6379, **options)
# URI::Generic.build automatically handles IPv6 addresses correctly:
self.new(URI::Generic.build(scheme: "redis", host: host, port: port), **options)
end

def self.unix(path, **options)
unix_endpoint = ::IO::Endpoint.unix(path, Socket::PF_UNIX)
self.new(URI::Generic.build(scheme: "unix", path:), unix_endpoint, **options)
end

SCHEMES = {
"redis" => URI::Generic,
Expand Down
Loading