[Twisted-Python] SQL, Threaded, and flows

Clark C. Evans cce at clarkevans.com
Sat Aug 9 15:41:19 MDT 2003


On Sat, Aug 09, 2003 at 05:28:34PM -0400, Edmund Dengler wrote:
| Added the import line, changed to query line to:
| 
|     query = Threaded(QueryIterator(dbpool, sql))
| 
| It now executes (no exceptions), but nothing is returned/printed. I am
| obviously missing something, but I don't know enough of the internals
| to hazard a guess as to what.

Yes, there is another stupid bug in the example, the
callLater(1,reactor.stop) line should be deleted and the 
reactor.stop() should go into the finish() function.  

| > | from twisted.internet import reactor
| > | def finish(result):
| > |     print "Deferred Complete : ", result
+         reactor.stop()
| > | f = flow.Deferred(consumer())
| > | f.addBoth(finish)
-   reactor.callLater(1,reactor.stop)
| > | reactor.run()

I'm also on IRC right now, or if you are in the US I can
give you a quick phone call. (send me personally your phone
if you want me to give you a quick phone call)

Best,

Clark




More information about the Twisted-Python mailing list