Class: Tina4::CacheBackends::ValkeyBackend

Inherits:
RedisBackend show all
Defined in:
lib/tina4/cache_backends/valkey_backend.rb

Overview

Valkey backend (parity with Python _ValkeyBackend). Valkey speaks the Redis wire protocol, so it reuses the Redis client / raw-RESP transport and only reports a different name.

Constant Summary

Constants inherited from RedisBackend

RedisBackend::PREFIX

Instance Method Summary collapse

Methods inherited from RedisBackend

#available?, #clear, #delete, #get, #name, #set, #stats

Methods inherited from BaseBackend

#available?, #clear, #delete, #get, #name, #set, #stats

Constructor Details

#initialize(url: "valkey://localhost:6379", max_entries: 1000) ⇒ ValkeyBackend

Returns a new instance of ValkeyBackend.



11
12
13
# File 'lib/tina4/cache_backends/valkey_backend.rb', line 11

def initialize(url: "valkey://localhost:6379", max_entries: 1000)
  super(url: url.sub(%r{^valkey://}, "redis://"), max_entries: max_entries, name: "valkey")
end