Skip to content

Commit

Permalink
chore: improve TaskWorker docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
provos committed Aug 31, 2024
1 parent 99e52e5 commit ba70a16
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/planai/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,22 @@ def __eq__(self, other):

@property
def name(self) -> str:
"""
Returns the name of this worker class.
:return: The name of the class.
:rtype: str
"""
return self.__class__.__name__

@property
def last_input_task(self) -> Optional[TaskWorkItem]:
"""
Returns the last input task consumed by this worker.
:return: The last input task as a TaskWorkItem object, or None if there is no last input task.
:rtype: Optional[TaskWorkItem]
"""
with self._state_lock:
return self._last_input_task

Expand Down

0 comments on commit ba70a16

Please sign in to comment.