def add_configurable(self, configurable_class, name, configurable):
configurable_class_name = configurable_class.__name__.lower()<EOL>logger.info("<STR_LIT>", configurable_class_name, name)<EOL>registry = self.registry_for(configurable_class)<EOL>if name in registry:<EOL><INDENT>logger.warn(<EOL>"<STR_LIT>",<EOL>configurable_class_name, name<EOL>)<EOL><DEDENT>registry[name] = configurable<EOL>hook = self.hook_for(configurable_class, action="<STR_LIT>")<EOL>if not hook:<EOL><INDENT>return<EOL><DEDENT>def done(f):<EOL><INDENT>try:<EOL><INDENT>f.result()<EOL><DEDENT>except Exception:<EOL><INDENT>logger.exception("<STR_LIT>", name)<EOL><DEDENT><DEDENT>self.work_pool.submit(hook, configurable).add_done_callback(done)<EOL>
Callback fired when a configurable instance is added.

Adds the configurable to the proper "registry" and calls a method
named "on_<configurable classname>_add" in the work pool if the hook
is defined.

If the added configurable is already present, `update_configurable()`
is called instead.