Class: AtomicCache::Storage::Store

Inherits:
Object
  • Object
show all
Defined in:
lib/atomic_cache/storage/store.rb

Direct Known Subclasses

Dalli, Memory

Instance Method Summary collapse

Instance Method Details

#add(key, new_value, ttl, user_options) ⇒ Object

This method is abstract.

(String, Object, Integer, Hash) -> Boolean

ttl is in millis operation must be atomic returns true when the key doesn’t exist and was written successfully returns false in all other cases

Raises:

  • (NotImplementedError)


15
# File 'lib/atomic_cache/storage/store.rb', line 15

def add(key, new_value, ttl, user_options); raise NotImplementedError end

#delete(key, user_options) ⇒ Object

This method is abstract.

(String) -> Boolean

returns true if it succeeds; false otherwise

Raises:

  • (NotImplementedError)


27
# File 'lib/atomic_cache/storage/store.rb', line 27

def delete(key, user_options); raise NotImplementedError end

#read(key, user_options) ⇒ Object

This method is abstract.

(String, Hash) -> String

return the value at key

Raises:

  • (NotImplementedError)


19
# File 'lib/atomic_cache/storage/store.rb', line 19

def read(key, user_options); raise NotImplementedError end

#set(key, new_value, user_options) ⇒ Object

This method is abstract.

(String, Object) -> Boolean

returns true if it succeeds; false otherwise

Raises:

  • (NotImplementedError)


23
# File 'lib/atomic_cache/storage/store.rb', line 23

def set(key, new_value, user_options); raise NotImplementedError end