rhettg / Tron

Next generation batch process scheduling and management
Other
11 stars 0 forks source link

Replace setTimout calls with a better implementation #9

Closed mtytel closed 13 years ago

mtytel commented 13 years ago

setTimeout is deprecated because it does not kill the query it sends after the timeout has elapsed. Then when the result is sent back, and AlreadyCalledError is raised.

http://twistedmatrix.com/trac/ticket/178

rhettg commented 13 years ago

Convert to proper timeout (closed by ed58486cdd2c3016fd71d2aa83c15022b3a4241a)

rhettg commented 13 years ago

This is resolved on my master.

Apparently the correct solution is to call: reactor.callLater(timeout, deferred.cancel)

However that only exists in super recent versions of twisted. So I also added a partial implementation for older versions that just errback directly if it hasn't been called.