server/hooksmanager.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 29 Mar 2010 13:34:06 +0200
branchstable
changeset 5060 ee3b856e1406
parent 4517 0f3c10fc42b2
child 5421 8167de96c523
permissions -rw-r--r--
[repo] optimize massive insertion/deletion by using the new set_operation function Idea is that on massive insertion, cost of handling the list of operation become non negligeable, so we should minimize the number of operations in that list. The set_operation function ease usage of operation associated to data in session.transaction_data, and we only add the operation when data set isn't initialized yet, else we simply add data to the set. The operation then simply process accumulated data.

from logilab.common.deprecation import class_renamed, class_moved
from cubicweb.server import hook
SystemHook = class_renamed('SystemHook', hook.Hook)
PropagateSubjectRelationHook = class_renamed('PropagateSubjectRelationHook',
                                             hook.PropagateSubjectRelationHook)
PropagateSubjectRelationAddHook = class_renamed('PropagateSubjectRelationAddHook',
                                                hook.PropagateSubjectRelationAddHook)
PropagateSubjectRelationDelHook = class_renamed('PropagateSubjectRelationDelHook',
                                                hook.PropagateSubjectRelationDelHook)
Hook = class_moved(hook.Hook)