Re: [Twisted-Python] Looping

2009-01-05 Thread Rob Hoadley
So one problem is understanding the reactor. It's only meant to be run once. Some of your code looks like it's trying to start it more than once. You only want one started at a time or weird things happen. I'd start here and make sure you understand the reactor: http://twistedmatrix.com/proje

Re: [Twisted-Python] db connections

2009-03-24 Thread Rob Hoadley
You'd want to use a connection pool to manage the db interaction. Your server is pretty unusable after a db connection failure. I've used the connection pool before with a cp_min of 1 and a cp_max of 2. http://twistedmatrix.com/documents/8.2.0/api/twisted.enterprise.adbapi.ConnectionPool.html O

Re: [Twisted-Python] db connections

2009-03-24 Thread Rob Hoadley
    self.dbcon = adbapi.ConnectionPool("pyPgSQL.PgSQL", database="data", > user='pet', host='local', password='some') > > if __name__ == "__main__": >     reactor.listenTCP(8080, MyFactory()) >     reactor.run() > > I usu

Re: [Twisted-Python] Twistd and application framework questions

2009-04-01 Thread Rob Hoadley
I can help you with this question: > 2)  There are still scenarios where I would want to run my code the > "reactor" way rather than than using the application framework, and I would > love to be able to keep a single file that's compatible with both modes.. > Is there a way to detect in runtime w

[Twisted-Python] testing a tac file

2009-06-29 Thread Rob Hoadley
Hi, I'm curious if anyone has written a trial test to verify the correct startup of a .tac file. I have a buildbot running automated trial tests on all the services I've written but nothing that closes the loop by building up the services by running the tac file similarly to the way that you'd use

Re: [Twisted-Python] deciding to use twisted or not

2009-09-01 Thread Rob Hoadley
I've handled this problem 2 ways: 1) for almost realtime... using twisted and .read() file as glyph mentioned and 2) used splunk and it's functionality to send search "matching" data to a program that in turn does http notification. This is at 5 min search intervals. As previous posters have ment