Class: ConvenientService::Support::Cache::Entities::Caches::ThreadSafeHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/convenient_service/support/cache/entities/caches/thread_safe_hash.rb

Instance Attribute Summary

Attributes inherited from Base

#default, #key, #parent, #store

Instance Method Summary collapse

Methods inherited from Base

#==, #[], #[]=, #get, keygen, #keygen, #set

Methods included from AbstractMethod

abstract_method

Constructor Details

#initializevoid



17
18
19
20
21
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_hash.rb', line 17

def initialize(...)
  super

  @lock = ::Mutex.new
end

Instance Method Details

#backendSymbol

Returns:

  • (Symbol)


26
27
28
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_hash.rb', line 26

def backend
  Constants::Backends::THREAD_SAFE_HASH
end

#clearConvenientService::Support::Cache::Entities::Caches::Array



75
76
77
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_hash.rb', line 75

def clear(...)
  @lock.synchronize { super }
end

#default=Object

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



96
97
98
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_hash.rb', line 96

def default=(...)
  @lock.synchronize { super }
end

#deleteObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



68
69
70
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_hash.rb', line 68

def delete(...)
  @lock.synchronize { super }
end

#empty?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_hash.rb', line 33

def empty?(...)
  @lock.synchronize { super }
end

#exist?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_hash.rb', line 40

def exist?(...)
  @lock.synchronize { super }
end

#fetchObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



61
62
63
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_hash.rb', line 61

def fetch(...)
  @lock.synchronize { super }
end

#readObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



47
48
49
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_hash.rb', line 47

def read(...)
  @lock.synchronize { super }
end

#scopeConvenientService::Support::Cache::Entities::Caches::Array



82
83
84
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_hash.rb', line 82

def scope(...)
  @lock.synchronize { super }
end

#scope!ConvenientService::Support::Cache::Entities::Caches::Array



89
90
91
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_hash.rb', line 89

def scope!(...)
  @lock.synchronize { super }
end

#writeObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



54
55
56
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_hash.rb', line 54

def write(...)
  @lock.synchronize { super }
end