Skip to content
This repository was archived by the owner on May 28, 2022. It is now read-only.

Commit 60edd28

Browse files
committed
chore: taskにdocstringを追加
1 parent 6a4c213 commit 60edd28

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

mi/ext/task/__init__.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,32 @@ def __init__(self, func, seconds=None):
88
self._task = None
99
self.stop_next_iteration = None
1010

11-
def start(self, *args, **kwargs):
11+
def start(self, *args, **kwargs) -> asyncio.Task:
12+
"""
13+
タスクを開始する
14+
15+
Parameters
16+
----------
17+
args : Any
18+
kwargs : Any
19+
20+
Returns
21+
-------
22+
_task : asyncio.Task
23+
"""
1224
_loop = asyncio.get_event_loop()
1325
self._task = _loop.create_task(self.task(*args, **kwargs))
1426
return self._task
1527

1628
def stop(self):
29+
"""
30+
タスクを停止
31+
32+
Returns
33+
-------
34+
None
35+
36+
"""
1737
if not self._task.done():
1838
self.stop_next_iteration = True
1939

@@ -26,7 +46,6 @@ async def task(self, *args, **kwargs):
2646

2747

2848
def loop(n):
29-
3049
def _deco(f):
3150
return Loop(f, n)
3251

0 commit comments

Comments
 (0)