-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Il 30/08/2012 20:15, Matteo Boscolo ha scritto: > Ciao A tutti > ho una classe fatta cosi... > > class Application(object): > ... > ... > def computeIntegration(self,nodeEngineName): > """ > compute the bom solved to the editor > """ > try: > if not nodeEngineName in self._nodesEngines: > raise ValueNot('Node engine not loaded') > > nodeTree=self._nodesEngines[nodeEngineName].getNodeRelationTree() > integrationServer = > xmlrpclib.ServerProxy("http://127.0.0.1:8500" ) > return integrationServer.*makeConfiguration*(nodeTree) > except Exception ,ex: > print_exc_plus() > raise ex > > e fin qui tutto ok ... > > la computeIntegration viene chiamata da un server SimpleXMLRPCServer e > viene eseguita correttamente. > > quello che vorrei ottenere e che alla chiamata xml-rpc la funzione venga > eseguita tutta senza aspettare l'esecuzione del metodo > *makeConfiguration* che impiega molto tempo
Quello che vuoi non è possibile. Se la funzione computeIntegration *deve* restituire il valore restituito dalla funzione makeConfiguration, allora ovviamente tale funzione deve essere eseguita prima che computeIntegration termini. > ho provato a sostituire il codice sopra con questo qui sotto commentato, > ma il metodo *makeConfiguration* viene eseguito e poi sembra che il > processo si interrompa. > > # nodeTree=self._nodesEngines[nodeEngineName].getNodeRelationTree() > # p=Process(target=startProcess, args=(nodeTree,)) > # p.start() > # logging.info("Configuration in process !! ") > # return "Configuration in Process.." > > #def startProcess(nodeTree): > # integrationServer = xmlrpclib.ServerProxy("http://127.0.0.1:8500" ) > # integrationServer.makeConfiguration(nodeTree) > > qualche idea ?? > Non ho capito quello che stai facendo. Il metodo startProcess da chi viene chiamato? Che implementazione di xmlrpc stai utilizzando? Ciao Manlio -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlA/t9IACgkQscQJ24LbaUTznwCgjY36LpqLcmZz851k+O3Dkt67 8OcAmwQHkBgdJBDDqeYLsHuoraWwmWIF =ff1a -----END PGP SIGNATURE----- _______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python