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:
parent
7d78cbcf4b
commit
53b111f4ae
2 changed files with 63 additions and 21 deletions
10
events.py
10
events.py
|
|
@ -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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue