Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add is-processing flag similar to typescript bindings #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions python/restate/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down