extmod/uasyncio: Add optional implementation of core uasyncio in C.

Implements Task and TaskQueue classes in C, using a pairing-heap data
structure.  Using this reduces RAM use of each Task, and improves overall
performance of the uasyncio scheduler.
This commit is contained in:
Damien George
2020-03-12 16:46:20 +11:00
parent 081d067662
commit bc009fdd62
6 changed files with 308 additions and 2 deletions

View File

@@ -4,8 +4,11 @@
from time import ticks_ms as ticks, ticks_diff, ticks_add
import sys, select
# Import TaskQueue and Task
from .task import TaskQueue, Task
# Import TaskQueue and Task, preferring built-in C code over Python code
try:
from _uasyncio import TaskQueue, Task
except:
from .task import TaskQueue, Task
################################################################################