From 00c6c6ba24896a781d5eb2fc9d847a863d3bb79f Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Thu, 5 Sep 2024 10:17:42 -0700 Subject: [PATCH] feat: export task lock via lock property in TaskWorker class --- src/planai/task.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/planai/task.py b/src/planai/task.py index f95d636..479520a 100644 --- a/src/planai/task.py +++ b/src/planai/task.py @@ -195,6 +195,16 @@ def name(self) -> str: """ return self.__class__.__name__ + @property + def lock(self) -> threading.Lock: + """ + Returns the lock object for this worker. + + :return: The lock object. + :rtype: threading.Lock + """ + return self._state_lock + @property def last_input_task(self) -> Optional[Task]: """