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

Handle signals #4

Open
jonhoo opened this issue Nov 3, 2017 · 1 comment
Open

Handle signals #4

jonhoo opened this issue Nov 3, 2017 · 1 comment

Comments

@jonhoo
Copy link
Owner

jonhoo commented Nov 3, 2017

We should add a dependency on ctrlc so that the worker can be told to cleanly exit when run_to_completion is called. The implementation will likely be fairly straightforward, essentially just storing STATUS_TERMINATING and letting the heartbeat thread do the cleanup (including failing the currently execution job). This may require some minor changes to make the heartbeat thread recognize that this is indeed a forced exit.

We may also want to allow the user to opt-in to signal handling for run, although that's less clear (we might instead want to return some kind of handle that the caller can use to signal to exit or wait for termination).

@rustworthy
Copy link
Collaborator

Suggesting to use signal and namely ctrl_c interceptor from tokio eco-system, since we are switching to async.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants