Retoor software development Projects Research SearchXNG
Register Sign In

16 lines
258 B
Plaintext
Raw Normal View History

feat: add scheduler module and refactor built-in module loading into shared modules.c Introduce a new scheduler module with fiber-based cooperative multitasking, including native bindings for resume operations and a Wren class for scheduling callables. Refactor the existing timer module and CLI code to use a centralized built-in module registry in modules.c, replacing direct includes of timer.h and timer.wren.inc. Update Xcode project and Makefile to compile the new scheduler.c, modules.c, and their generated .wren.inc sources.
2015-09-13 20:32:39 +02:00
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
Reference in New Issue Copy Permalink
f12581a674
wren/test/scheduler/add.wren
Response time: 47ms
Mail Licenses API