def spawnWithStore(self, here, there): """ 'here' and 'there' are the helper protocols 'there' will expect to be created with an instance of a store. """ master = yield self.spawn(AMP(), StoreCreator) yield master.callRemote(CreateStore, delegateTo=qual(there)) returnValue(swapAMP(master, here))
def spawnWithConfig(self, config, here, there): """ Similar to spawnWithStore except the child process gets a configuration object instead. """ master = yield self.spawn(AMP(), StoreCreator) subcfg = copy.deepcopy(self.config) del subcfg._postUpdateHooks[:] yield master.callRemote(PickleConfig, config=subcfg, delegateTo=qual(there)) returnValue(swapAMP(master, here))
def pickleConfig(self, config, delegateTo): # from twistedcaldav.config import config as globalConfig # globalConfig._data = config._data swapAMP(self, namedAny(delegateTo)(config)) return {}
def createStore(self, delegateTo): """ Create a store and pass it to the named delegate class. """ swapAMP(self, namedAny(delegateTo)(SQLStoreBuilder.childStore())) return {}