Class: ConvenientService::Support::Cache::Entities::Caches::ThreadSafeArray

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

Instance Method Summary collapse

Methods inherited from Array

#store

Methods inherited from Base

#==, #[], #[]=, keygen, #keygen, #scope

Methods included from AbstractMethod

abstract_method

Constructor Details

#initialize(array = []) ⇒ void



14
15
16
17
18
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_array.rb', line 14

def initialize(array = [])
  super

  @lock = ::Mutex.new
end

Instance Method Details

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



65
66
67
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_array.rb', line 65

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

#deleteObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



58
59
60
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_array.rb', line 58

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

#empty?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_array.rb', line 23

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

#exist?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_array.rb', line 30

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

#fetchObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



51
52
53
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_array.rb', line 51

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

#readObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



37
38
39
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_array.rb', line 37

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

#writeObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



44
45
46
# File 'lib/convenient_service/support/cache/entities/caches/thread_safe_array.rb', line 44

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