Lines Matching refs:scheduler
45 scheduler = sched.scheduler(time.time, time.sleep)
47 z = scheduler.enter(x, 1, fun, (x,))
48 scheduler.run()
54 scheduler = sched.scheduler(time.time, time.sleep)
56 z = scheduler.enterabs(x, 1, fun, (x,))
57 scheduler.run()
64 scheduler = sched.scheduler(timer.time, timer.sleep)
65 scheduler.enter(1, 1, fun, (1,))
66 scheduler.enter(3, 1, fun, (3,))
67 t = threading.Thread(target=scheduler.run)
73 z = scheduler.enter(x - 1, 1, fun, (x,))
92 scheduler = sched.scheduler(time.time, time.sleep)
94 z = scheduler.enterabs(0.01, priority, fun, (priority,))
95 scheduler.run()
101 scheduler = sched.scheduler(time.time, time.sleep)
103 event1 = scheduler.enterabs(now + 0.01, 1, fun, (0.01,))
104 event2 = scheduler.enterabs(now + 0.02, 1, fun, (0.02,))
105 event3 = scheduler.enterabs(now + 0.03, 1, fun, (0.03,))
106 event4 = scheduler.enterabs(now + 0.04, 1, fun, (0.04,))
107 event5 = scheduler.enterabs(now + 0.05, 1, fun, (0.05,))
108 scheduler.cancel(event1)
109 scheduler.cancel(event5)
110 scheduler.run()
117 scheduler = sched.scheduler(timer.time, timer.sleep)
119 event1 = scheduler.enterabs(now + 1, 1, fun, (1,))
120 event2 = scheduler.enterabs(now + 2, 1, fun, (2,))
121 event4 = scheduler.enterabs(now + 4, 1, fun, (4,))
122 event5 = scheduler.enterabs(now + 5, 1, fun, (5,))
123 event3 = scheduler.enterabs(now + 3, 1, fun, (3,))
124 t = threading.Thread(target=scheduler.run)
129 scheduler.cancel(event2)
130 scheduler.cancel(event5)
147 scheduler = sched.scheduler(time.time, time.sleep)
148 self.assertTrue(scheduler.empty())
150 z = scheduler.enterabs(x, 1, fun, (x,))
151 self.assertFalse(scheduler.empty())
152 scheduler.run()
153 self.assertTrue(scheduler.empty())
158 scheduler = sched.scheduler(time.time, time.sleep)
160 e5 = scheduler.enterabs(now + 0.05, 1, fun)
161 e1 = scheduler.enterabs(now + 0.01, 1, fun)
162 e2 = scheduler.enterabs(now + 0.02, 1, fun)
163 e4 = scheduler.enterabs(now + 0.04, 1, fun)
164 e3 = scheduler.enterabs(now + 0.03, 1, fun)
167 self.assertEqual(scheduler.queue, [e1, e2, e3, e4, e5])
175 scheduler = sched.scheduler(time.time, time.sleep)
176 scheduler.enterabs(now, 1, fun)
177 scheduler.enterabs(now, 1, fun, argument=(1, 2))
178 scheduler.enterabs(now, 1, fun, argument=('a', 'b'))
179 scheduler.enterabs(now, 1, fun, argument=(1, 2), kwargs={"foo": 3})
180 scheduler.run()
191 scheduler = sched.scheduler(time.time, time.sleep)
193 scheduler.enter(x, 1, fun, (x,))
194 scheduler.run(blocking=False)