[Python] xml-rpc a miltiprocess

2012-08-30 Per discussione Matteo Boscolo

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
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 ??

ciao,
Matteo

___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] xml-rpc a miltiprocess

2012-08-30 Per discussione Manlio Perillo
-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


Re: [Python] xml-rpc a miltiprocess

2012-08-30 Per discussione Matteo Boscolo

Il 30/08/2012 20:58, Manlio Perillo ha scritto:

-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.


in pratica ci sono due server xml-rpc
uno che risolve una struttura a nodi (A)
e uno che legge questa struttura apre dei file 3d e ci fa del lavoro 
sopra (B)


i due server parlano fra di loro e naturalmente il tempo computazionale 
del primo (A) e piu' veloce del secondo (B)


quello che sto cercando di fare computare tutti i node tree e lasciare 
che la giometria 3d vada per la sua strada ..


in piu' mentre faccio della computazione qualche client collegato al 
server (A) potrebbe dire  che c'e' da risolvere qualche altro nodetree ..




Il metodo startProcess da chi viene chiamato?

da Process

Che implementazione di xmlrpc stai utilizzando?

SimpleXMLRPCServer


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



___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] xml-rpc a miltiprocess

2012-08-30 Per discussione Matteo Boscolo

Il 30/08/2012 20:58, Manlio Perillo ha scritto:

-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.

be questo e da vedere e lo dici tu ...

Se la funzione computeIntegration *deve* restituire il valore restituito
dalla funzione makeConfiguration, allora ovviamente tale funzione deve
essere eseguita prima che computeIntegration termini.

certo questo e vero, ma non e' detto che il valore di ritorno mi serva..
sto solo sperimentando in modo semplice per capire cosa fare, il codice 
riportato e migliorabilissimo...

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



___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python