Skip to content

[Feature request] Add isShutdownRequested method #51

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

Closed
astronom opened this issue Mar 30, 2022 · 1 comment
Closed

[Feature request] Add isShutdownRequested method #51

astronom opened this issue Mar 30, 2022 · 1 comment

Comments

@astronom
Copy link

I suppose it will be a good feature to add the ability for commands to check if a shutdown was requested, e.g. in finish iteration I have a code that should wait some time to the next iteration, but if I can check that command should be shut down so there is no reason to execute this code.

If You agree, I can make a PR

@mac-cain13
Copy link
Owner

Sorry for the very very late reply, cleaning up some open issues here. :)

Yes I think it's good to be able to check if shutdown was requested if you do long running operations yourselves. Either being able to read the now private variable or have a method to access that information would be great I think.

Having said that, it still is better to make sure you break up long running operation into smaller batches if possible. That also makes memory leaks more visible and fixes that the shutdown sequence is performed automatically. But there are certainly cases where doing this check is very handy.

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