kozan-scheduler 0.1.0

Task scheduler and async executor for the Kozan UI platform
Documentation
  • Coverage
  • 95%
    133 out of 140 items documented0 out of 110 items with examples
  • Size
  • Source code size: 113.85 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 8.02 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 47s Average build duration of successful builds.
  • all releases: 47s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • darkyeg

kozan-scheduler — Task scheduler and async executor for Kozan.

Like Chrome's base/task/ + blink/platform/scheduler/. Standalone crate — zero dependency on kozan-core.

Architecture

Scheduler (MainThreadScheduler — the event loop)
├── TaskQueueManager (SequenceManager — priority picker)
│   └── TaskQueue × 6 (one per priority level)
├── MicrotaskQueue (drain after each macrotask)
├── LocalExecutor (!Send async runtime)
├── FrameScheduler (vsync-driven frame timing)
└── WakeReceiver (cross-thread task delivery)

Event loop algorithm (HTML spec)

loop {
    1. Receive cross-thread tasks
    2. Promote delayed tasks
    3. Poll async executor
    4. Pick ONE macrotask → run
    5. Drain ALL microtasks
    6. If frame due → callbacks → style → layout → paint
    7. Park until next event
}