Class: Redis::Client
- Inherits:
-
RedisClient
show all
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb
Constant Summary
collapse
- ERROR_MAPPING =
{
RedisClient::ConnectionError => Redis::ConnectionError,
RedisClient::CommandError => Redis::CommandError,
RedisClient::ReadTimeoutError => Redis::TimeoutError,
RedisClient::CannotConnectError => Redis::CannotConnectError,
RedisClient::AuthenticationError => Redis::CannotConnectError,
RedisClient::FailoverError => Redis::CannotConnectError,
RedisClient::PermissionError => Redis::PermissionError,
RedisClient::WrongTypeError => Redis::WrongTypeError,
RedisClient::ReadOnlyError => Redis::ReadOnlyError,
RedisClient::ProtocolError => Redis::ProtocolError,
RedisClient::OutOfMemoryError => Redis::OutOfMemoryError,
}
Constants inherited
from RedisClient
RedisClient::AuthenticationError, RedisClient::CannotConnectError, RedisClient::CheckoutTimeoutError, RedisClient::ConnectionError, RedisClient::Error, RedisClient::FailoverError, RedisClient::MasterDownError, RedisClient::OutOfMemoryError, RedisClient::PermissionError, RedisClient::ProtocolError, RedisClient::ReadOnlyError, RedisClient::ReadTimeoutError, RedisClient::TimeoutError, RedisClient::UnsupportedServer, RedisClient::VERSION, RedisClient::WriteTimeoutError, RedisClient::WrongTypeError
Instance Attribute Summary
#config, #connect_timeout, #read_timeout, #write_timeout
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from RedisClient
#blocking_call, #call, #call_once, #call_once_v, #close, #connected?, default_driver, default_driver=, driver, #hscan, #initialize, #inspect, new, #pubsub, #read_timeout=, register, register_driver, #scan, #size, #sscan, #timeout=, #with, #write_timeout=, #zscan
#initialize, #timeout=
Constructor Details
This class inherits a constructor from RedisClient
Class Method Details
.config(**kwargs) ⇒ Object
22
23
24
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 22
def config(**kwargs)
super(protocol: 2, **kwargs)
end
|
.sentinel(**kwargs) ⇒ Object
26
27
28
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 26
def sentinel(**kwargs)
super(protocol: 2, **kwargs)
end
|
Instance Method Details
#blocking_call_v(timeout, command, &block) ⇒ Object
78
79
80
81
82
83
84
85
86
87
88
89
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 78
def blocking_call_v(timeout, command, &block)
if timeout && timeout > 0
timeout += 0.1
end
super(timeout, command, &block)
rescue ::RedisClient::Error => error
translate_error!(error)
end
|
#call_v(command, &block) ⇒ Object
72
73
74
75
76
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 72
def call_v(command, &block)
super(command, &block)
rescue ::RedisClient::Error => error
translate_error!(error)
end
|
43
44
45
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 43
def db
config.db
end
|
#disable_reconnection(&block) ⇒ Object
103
104
105
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 103
def disable_reconnection(&block)
ensure_connected(retryable: false, &block)
end
|
47
48
49
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 47
def host
config.host unless config.path
end
|
31
32
33
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 31
def id
config.id
end
|
#inherit_socket! ⇒ Object
107
108
109
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 107
def inherit_socket!
@inherit_socket = true
end
|
97
98
99
100
101
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 97
def multi
super
rescue ::RedisClient::Error => error
translate_error!(error)
end
|
63
64
65
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 63
def password
config.password
end
|
55
56
57
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 55
def path
config.path
end
|
#pipelined ⇒ Object
91
92
93
94
95
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 91
def pipelined
super
rescue ::RedisClient::Error => error
translate_error!(error)
end
|
51
52
53
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 51
def port
config.port unless config.path
end
|
#server_url ⇒ Object
35
36
37
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 35
def server_url
config.server_url
end
|
39
40
41
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 39
def timeout
config.read_timeout
end
|
59
60
61
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-5.0.5/lib/redis/client.rb', line 59
def username
config.username
end
|