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