@@ -15,29 +15,29 @@ def __init__(self, maxlen: int = 100):
1515 def add (self , thread : ActionThread ):
1616 """
1717
18- :param thread: ActionThread:
18+ :param thread: ActionThread:
1919
2020 """
2121 self .threads .append (thread )
2222
2323 def start (self , thread : ActionThread ):
2424 """
2525
26- :param thread: ActionThread:
26+ :param thread: ActionThread:
2727
2828 """
2929 self .add (thread )
3030 thread .start ()
3131
32- def spawn (self , function , * args , ** kwargs ):
32+ def spawn (self , action : str , function , * args , ** kwargs ):
3333 """
3434
35- :param function:
36- :param *args:
37- :param **kwargs:
35+ :param function:
36+ :param *args:
37+ :param **kwargs:
3838
3939 """
40- thread = ActionThread (target = function , args = args , kwargs = kwargs )
40+ thread = ActionThread (action , target = function , args = args , kwargs = kwargs )
4141 self .start (thread )
4242 return thread
4343
@@ -90,7 +90,7 @@ def get(self, task_id):
9090 def discard_id (self , task_id ):
9191 """
9292
93- :param task_id:
93+ :param task_id:
9494
9595 """
9696 marked_for_discard = set ()
@@ -122,7 +122,7 @@ def join(self):
122122
123123def current_action ():
124124 """Return the ActionThread instance in which the caller is currently running.
125-
125+
126126 If this function is called from outside an ActionThread, it will return None.
127127
128128
@@ -137,7 +137,7 @@ def current_action():
137137
138138def update_action_progress (progress : int ):
139139 """Update the progress of the ActionThread in which the caller is currently running.
140-
140+
141141 If this function is called from outside an ActionThread, it will do nothing.
142142
143143 :param progress: int: Action progress, in percent (0-100)
@@ -151,7 +151,7 @@ def update_action_progress(progress: int):
151151
152152def update_action_data (data : dict ):
153153 """Update the data of the ActionThread in which the caller is currently running.
154-
154+
155155 If this function is called from outside an ActionThread, it will do nothing.
156156
157157 :param data: dict: Action data dictionary
0 commit comments