Class: Dalli::Socket::UNIX
- Inherits:
-
UNIXSocket
- Object
- UNIXSocket
- Dalli::Socket::UNIX
- Includes:
- InstanceMethods
- Defined in:
- lib/dalli/socket.rb,
lib/dalli/socket.rb
Overview
UNIX represents a UNIX domain socket, which is an interprocess communication mechanism between processes on the same host. Used when the Memcached server is running on the same machine as the Dalli client.
Constant Summary
Constants included from InstanceMethods
InstanceMethods::FILTERED_OUT_OPTIONS
Instance Attribute Summary collapse
-
#options ⇒ Object
options - supports enhanced logging in the case of a timeout server - used to support IO.select in the pipelined getter.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*_args) ⇒ UNIX
constructor
A new instance of UNIX.
Methods included from InstanceMethods
#logged_options, #read_available, #readfull
Constructor Details
#initialize(*_args) ⇒ UNIX
Returns a new instance of UNIX.
222 223 224 |
# File 'lib/dalli/socket.rb', line 222 def initialize(*_args) raise Dalli::DalliError, 'Unix sockets are not supported on Windows platform.' end |
Instance Attribute Details
#options ⇒ Object
options - supports enhanced logging in the case of a timeout server - used to support IO.select in the pipelined getter
238 239 240 |
# File 'lib/dalli/socket.rb', line 238 def @options end |
Class Method Details
.init_socket_options(sock, options) ⇒ Object
249 250 251 252 253 |
# File 'lib/dalli/socket.rb', line 249 def self.(sock, ) # https://man7.org/linux/man-pages/man7/unix.7.html sock.setsockopt(::Socket::SOL_SOCKET, ::Socket::SO_SNDBUF, [:sndbuf]) if [:sndbuf] sock.timeout = [:socket_timeout] if [:socket_timeout] && sock.respond_to?(:timeout=) end |
.open(path, options = {}) ⇒ Object
240 241 242 243 244 245 246 247 |
# File 'lib/dalli/socket.rb', line 240 def self.open(path, = {}) Timeout.timeout([:socket_timeout]) do sock = new(path) sock. = { path: path }.merge() (sock, ) sock end end |