@@ -18,27 +18,45 @@ async def set_result(
1818 task_id : str ,
1919 result : TaskiqResult [_ReturnType ],
2020 ) -> None :
21- # Here you must set result somewhere.
22- pass
21+ """
22+ Set result in your backend.
23+
24+ :param task_id: current task id.
25+ :param result: result of execution.
26+ """
2327
2428 async def get_result (
2529 self ,
2630 task_id : str ,
2731 with_logs : bool = False ,
2832 ) -> TaskiqResult [_ReturnType ]:
29- # Here you must retrieve result by id.
33+ """
34+ Here you must retrieve result by id.
35+
36+ Logs is a part of a result.
37+ Here we have a parameter whether you want to
38+ fetch result with logs or not, because logs
39+ can have a lot of info and sometimes it's critical
40+ to get only needed information.
3041
31- # Logs is a part of a result.
32- # Here we have a parameter whether you want to
33- # fetch result with logs or not, because logs
34- # can have a lot of info and sometimes it's critical
35- # to get only needed information.
36- pass
42+ :param task_id: id of a task.
43+ :param with_logs: whether to fetch logs.
44+ :return: result.
45+ """
46+ return ... # type: ignore
3747
3848 async def is_result_ready (
3949 self ,
4050 task_id : str ,
4151 ) -> bool :
42- # This function checks if result of a task exists,
43- # without actual fetching the result.
44- pass
52+ """
53+ Check if result exists.
54+
55+ This function must check whether result
56+ is available in your resul backend
57+ without fetching the result.
58+
59+ :param task_id: id of a task.
60+ :return: True if result is ready.
61+ """
62+ return ... # type: ignore
0 commit comments