You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
TaskManager: return task just like asyncio.create_task()
This commit is contained in:
@@ -36,13 +36,19 @@ class TaskManager:
|
||||
def stop(cls):
|
||||
cls.keep_running = False
|
||||
|
||||
@classmethod
|
||||
def enable(cls):
|
||||
cls.disabled = False
|
||||
|
||||
@classmethod
|
||||
def disable(cls):
|
||||
cls.disabled = True
|
||||
|
||||
@classmethod
|
||||
def create_task(cls, coroutine):
|
||||
cls.task_list.append(asyncio.create_task(coroutine))
|
||||
task = asyncio.create_task(coroutine)
|
||||
cls.task_list.append(task)
|
||||
return task
|
||||
|
||||
@classmethod
|
||||
def list_tasks(cls):
|
||||
|
||||
Reference in New Issue
Block a user