Skip to content

Commit 2d8a26b

Browse files
TaskManager: return task just like asyncio.create_task()
1 parent a28bb4c commit 2d8a26b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal_filesystem/lib/mpos/task_manager.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,19 @@ def start(cls):
3636
def stop(cls):
3737
cls.keep_running = False
3838

39+
@classmethod
40+
def enable(cls):
41+
cls.disabled = False
42+
3943
@classmethod
4044
def disable(cls):
4145
cls.disabled = True
4246

4347
@classmethod
4448
def create_task(cls, coroutine):
45-
cls.task_list.append(asyncio.create_task(coroutine))
49+
task = asyncio.create_task(coroutine)
50+
cls.task_list.append(task)
51+
return task
4652

4753
@classmethod
4854
def list_tasks(cls):

0 commit comments

Comments
 (0)