Sha256: f67b1bbb8cbcfadcbbdbfd05b47dae32bfb5573dd2449c5e2fff0fb6260c7660
Contents?: true
Size: 967 Bytes
Versions: 11
Compression:
Stored size: 967 Bytes
Contents
require 'forwardable' require 'dalli' module Sym module App module Password module Providers class MemcachedProvider attr_accessor :dalli def initialize(**opts) # disable logging Dalli.logger = Sym::Constants::Log::NIL self.dalli = ::Dalli::Client.new( * Sym::Configuration.config.password_cache_arguments[:memcached][:args], ** Sym::Configuration.config.password_cache_arguments[:memcached][:opts].merge!(opts) ) end def alive? dalli.alive! true rescue Dalli::RingError => e false end def read(key) dalli.get(key) end def write(key, value, *) dalli.set(key, value) end def clear dalli.flush end end register MemcachedProvider end end end end
Version data entries
11 entries across 11 versions & 1 rubygems