Hi Bino,

On Jan 9, 2012, at 12:39 AM, bino oetomo wrote:

> How to migrate that script to twistd, something like :

First of all, it's probably not appropriate to launch a WX GUI with twistd.  
It's possible, but you don't get a lot of benefit.  If you are running in a GUI 
environment, your users likely have different expectations of logging, 
daemonization, etc, than they would with a background daemon.

Second, your script below looks mostly sensible; I assume that "MyRPC" is a 
version of MyXMLRPCApp that isn't a wx.App. I'm assuming that you want to run 
this as a .tac file, (i.e. with "twistd -y").  If that's the case, then you're 
on the right track.

> ------------------
> #Create Application
> application = service.Application("MultiService Example")
> #Create xmlrpc site
> myrpc = MyRPC()
> site = server.Site(myrpc)
> myrpcservice = internet.TCPServer(50008, site, interface='localhost')
> #Creating Multi Service
> multiService = service.MultiService()
> #Add our Services to multiservice
> myrpcservice.setServiceParent(multiService)
> #Set created application to be serviceparent of multiservice
> multiService.setServiceParent(application)
> ------------------

_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to