From 33f4e9f029e0573f168237b8db030de537453878 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Thu, 28 Jan 2021 09:30:29 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20Add=20`Process.is=5Fk?= =?UTF-8?q?illing`=20property=20(#199)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plumpy/processes.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plumpy/processes.py b/plumpy/processes.py index adb77146..782d9512 100644 --- a/plumpy/processes.py +++ b/plumpy/processes.py @@ -1107,7 +1107,12 @@ def kill(self, msg: Union[str, None] = None) -> Union[bool, asyncio.Future]: self.transition_to(process_states.ProcessState.KILLED, msg) return True - # endregion + @property + def is_killing(self) -> bool: + """Return if the process is already being killed.""" + return self._killing is not None + + # endregion def create_initial_state(self) -> process_states.State: """This method is here to override its superclass.