Add module for Scheduler.

Also reorganizes some code to make it easier to add more modules.
This commit is contained in:
Bob Nystrom
2015-09-13 11:32:39 -07:00
parent f36a795534
commit ea5c3b01eb
18 changed files with 291 additions and 110 deletions
+15
View File
@@ -0,0 +1,15 @@
import "scheduler" for Scheduler
import "timer" for Timer
var run = false
Scheduler.add {
run = true
}
// Does not run immediately.
IO.print(run) // expect: false
Timer.sleep(0)
// Runs when the main fiber suspends on IO.
IO.print(run) // expect: true