I know you can use signal.alarm()
to schedule alarms in your main thread, but is there a way to do something like this in a thread that isn't your main thread, since these threads can't receive signals? I need to schedule something to happen 5 minutes in the future.
Use Timer
instead of signals. Dealing with signals will open up lots of cans of worms, so you should avoid it whenever you can. In this case, it sounds like you can.
You can use threading.Event to notify your threads about events. Have a look at threading.Timer as well.
Timer
class - Jason LeBrun 2012-04-05 21:59