Esempio n. 1
0
 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))
Esempio n. 2
0
 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))
Esempio n. 3
0
 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))
Esempio n. 4
0
 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))
Esempio n. 5
0
 def pickleConfig(self, config, delegateTo):
     # from twistedcaldav.config import config as globalConfig
     # globalConfig._data = config._data
     swapAMP(self, namedAny(delegateTo)(config))
     return {}
Esempio n. 6
0
 def createStore(self, delegateTo):
     """
     Create a store and pass it to the named delegate class.
     """
     swapAMP(self, namedAny(delegateTo)(SQLStoreBuilder.childStore()))
     return {}
Esempio n. 7
0
 def pickleConfig(self, config, delegateTo):
     # from twistedcaldav.config import config as globalConfig
     # globalConfig._data = config._data
     swapAMP(self, namedAny(delegateTo)(config))
     return {}
Esempio n. 8
0
 def createStore(self, delegateTo):
     """
     Create a store and pass it to the named delegate class.
     """
     swapAMP(self, namedAny(delegateTo)(SQLStoreBuilder.childStore()))
     return {}