KMKfw / kmk_firmware

Clackety Keyboards Powered by Python
https://kmkfw.zulipchat.com
Other
1.39k stars 474 forks source link

Enhancement heap scheduler #757

Closed xs5871 closed 1 year ago

xs5871 commented 1 year ago

Let's abuse _asyncios TaskQueue to implement a very simple priority queue task scheduler. Despite documentation, Circuitpython doesn't usually ship with a min-heap module; it does however implement a pairing-heap for TaskQueue in native code.

Why not use asyncio directly?

An example of a periodically self-rescheduling task is included with the RGB extension.