0:f5aecaad0bcf | 1:4cdc9c1f6b28 |
---|---|
1 # | |
2 # Borgend scheduler | |
3 # | |
4 | |
5 from Queue import Queue | |
6 from runborg import BorgInstance | |
7 import sched | |
8 import ui | |
9 | |
10 def scheduler(sched): | |
11 timeout=??? | |
12 q=sched.eventqueue | |
13 while True: | |
14 timeout, timerevent=next_timed_event(sched); | |
15 t=Timer(timeout, lambda: q.put(timerevent)); | |
16 event=sq.get(True): | |
17 # Decide what to do | |
18 | |
19 class Scheduler: | |
20 | |
21 def __init__(self, backups): | |
22 self.backups=backups | |
23 self.eventqueue=Queue() | |
24 self.t=Thread(target=scheduler, args=self) |