Class: Hydra::Keycloak::Store::MemcachedClient

Inherits:
Object
  • Object
show all
Extended by:
Mixin
Defined in:
lib/hydra/keycloak/store/memcached_client.rb

Instance Method Summary collapse

Methods included from Mixin

args_inject, container, inject

Instance Method Details

#delete(key) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/hydra/keycloak/store/memcached_client.rb', line 30

def delete(key)
  dalli.delete(key)

  Success(:ok)
rescue Dalli::DalliError => e
  Failure(code: :memcached_unavailable,
          context: { args: { key: key }, action: :delete, error: e.message, caller: caller })
end

#get(key) ⇒ Object



23
24
25
26
27
28
# File 'lib/hydra/keycloak/store/memcached_client.rb', line 23

def get(key)
  Success(dalli.get(key))
rescue Dalli::DalliError => e
  Failure(code: :memcached_unavailable,
          context: { args: { key: key }, action: :get, error: e.message, caller: caller })
end

#set(key, value) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/hydra/keycloak/store/memcached_client.rb', line 14

def set(key, value)
  dalli.set(key, value)

  Success(:ok)
rescue Dalli::DalliError => e
  Failure(code: :memcached_unavailable,
          context: { args: { key: key }, action: :set, error: e.message, caller: caller })
end