Python twisted: how to schedule?
Having 1-day experience in Twisted I try to schedule message sending in reply to tcp client: import os, sys, time from twisted.internet import protocol, reactor self.scenario = [(1, "Message after 1 sec!"), (4, "This after 4 secs"), (2, "End final after 2 secs")] for timeout, data in self.scenario: reactor.callLater(timeout, self.sendata, data) print "waited %d time, sent %s\n"%(timeout, data) Now it sends messages, but I have 2 problems: 1) "timeout" is going from "now", and I want to count it after each previous task was completed (previous message was sent) 2) I don't know how to close