-
Notifications
You must be signed in to change notification settings - Fork 100
Add shutdown API #47
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 shutdown API #47
Conversation
# Conflicts: # src/lib.rs # src/protos/mod.rs # tests/integ_tests/poller_test.rs
# Conflicts: # src/lib.rs # src/machines/test_help/mod.rs # tests/integ_tests/simple_wf_tests.rs
| /// replay have an opportunity to finish. This means that the lang sdk will need to call | ||
| /// [Core::complete_task] for those workflows until they are done. At that point, the lang | ||
| /// SDK can end the process, or drop the [Core] instance, which will close the connection. | ||
| fn shutdown(&self) -> Result<()>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Java we have two ways to shutdown: shutdown and shutdown now. The former is a clean shutdown and the latter is an immediate shutdown without waiting for tasks to complete.
There is also awaitTermination that allows waiting for shutdown for a specified timeout.
I think we need to support all the above features. But I'm not saying the API should be the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mfateev Not sure either of those actually belong in core. Lang SDK can decide all by itself if it wants to exit abruptly (it can just terminate the process) -- same with the timeout. If it has not polled core enough to drain the queue completely, it can know that and decide to terminate then as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna merge this so I can use it in some of the existing PRs, but we can definitely come back to this if needed.
# Conflicts: # src/lib.rs
Allows the lang SDK to ensure server will no longer be polled while performing orderly shutdown.
Allows the lang SDK to ensure server will no longer be polled while performing orderly shutdown.
Depends on #46 being merged first.