Class: TorqueBox::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/torquebox/registry.rb

Constant Summary collapse

MUTEX =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Mutex.new

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/torquebox/registry.rb', line 32

def [](key)
  value = nil
  MUTEX.synchronize do
    value = registry[key]
  end
  value
end

.has_key?(key) ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
43
44
# File 'lib/torquebox/registry.rb', line 40

def has_key?(key)
  MUTEX.synchronize do
    registry.has_key?(key)
  end
end

.merge!(hash) ⇒ Object



26
27
28
29
30
# File 'lib/torquebox/registry.rb', line 26

def merge!(hash)
  MUTEX.synchronize do
    registry.merge!(hash)
  end
end

.registryObject



46
47
48
# File 'lib/torquebox/registry.rb', line 46

def registry
  @registry ||= {}
end