[Twisted-Python] difficulty in calling callLater from callback
martin at datacash.com
Wed Dec 10 13:10:09 EST 2003
I'm trying to get a set of database updates (read_db_response())
run once a second or so.
dbpool = adbapi.ConnectionPool( "MySQLdb", host = 'localhost', user = 'martin', passwd = 'passwd', db = 'request' )
cursor.execute( "update 1" )
cursor.execute( "update 2" )
cursor.execute( "update 3" )
dbpool.runInteraction( read_db_response ).addCallback( reactor.callLater, 1, read_loop )
I thought I could do this by attaching a callback to
dbpool.runInteraction(), and have that callback schedule
the next call of read_loop().
What happens is that read_db_response() runs exactly once.
Does anyone know what I have done wrong here ?
More information about the Twisted-Python