Shiny new event system that uses Twisted's task stuff. This one is a good bit more flexible and semantically correct. More to come on this soon.

This commit is contained in:
Greg Taylor 2007-05-23 19:00:37 +00:00
parent 7d78cbcf4b
commit 53b111f4ae
2 changed files with 63 additions and 21 deletions

View file

@ -6,16 +6,8 @@ import session_mgr
Holds the events scheduled in scheduler.py.
"""
# Dictionary of events with a list in the form of: [<interval>, <lastrantime>]
schedule = {
'check_sessions': [60, None]
}
def check_sessions():
"""
Event: Check all of the connected sessions.
"""
session_mgr.check_all_sessions()
schedule['check_sessions'][1] = time.time()
reactor.callLater(schedule['check_sessions'][0], check_sessions)
session_mgr.check_all_sessions()