Sha256: 2052c67e1c543e471e192dbdf77fea0b346e3c8954cf5b2acb88f4596f06c3da
Contents?: true
Size: 600 Bytes
Versions: 14
Compression:
Stored size: 600 Bytes
Contents
# encoding: utf-8 module Punchblock class Client class ComponentRegistry def initialize @mutex = Mutex.new @components = Hash.new end def <<(component) @mutex.synchronize do @components[component.component_id] = component end end def find_by_id(component_id) @mutex.synchronize do @components[component_id] end end def delete(component) @mutex.synchronize do id = @components.key component @components.delete id end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems