Class: TorqueBox::Registry

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

Constant Summary

MUTEX =
Mutex.new

Class Method Summary (collapse)

Class Method Details

+ (Object) [](key)



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

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

+ (Boolean) has_key?(key)

Returns:

  • (Boolean)


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

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

+ (Object) merge!(hash)



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

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

+ (Object) registry



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

def registry
  @registry ||= {}
end