diff --git a/python/restate/vm.py b/python/restate/vm.py index 54b2551..90eae59 100644 --- a/python/restate/vm.py +++ b/python/restate/vm.py @@ -345,3 +345,7 @@ def sys_end(self): It calls the `sys_end` method of the `vm` object. """ self.vm.sys_end() + + def is_processing(self) -> bool: + """Returns true if the VM is processing, and false if it is replaying execution""" + return self.vm.is_processing() diff --git a/src/lib.rs b/src/lib.rs index 3635f55..295a4c9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -587,6 +587,10 @@ impl PyVM { fn sys_end(mut self_: PyRefMut<'_, Self>) -> Result<(), PyVMError> { self_.vm.sys_end().map(Into::into).map_err(Into::into) } + + fn is_processing(self_: PyRef<'_, Self>) -> bool { + self_.vm.is_processing() + } } #[pyclass]