-
Notifications
You must be signed in to change notification settings - Fork 278
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
Pre-exit cleanup callback #137
Comments
I've partially done this by removing the existing |
I'd really like this feature, especially as I use Vorpal to provide an interactive environment for managing a database. Being able to safely close a connection on exit or sigterm would be wonderful. |
+1 I've checked the sources and find Vorpal API incomplete: Since Another advantage of re-accessing previously registered commands would be support for compiling custom commands using plugins and similar kinds of modules, even though this might require more efforts that probably aren't considerable part of vorpal as a lightweight core. Finally, IMHO best solution would be to have some event emitted before exiting session when using vorpal's common implementation of UPDATE: In addition to request of @steelbrain I'd love to have a CLI framework providing common hook for acting on exiting CLI application, that is using command |
Any chance this will be implemented? |
Unlikely unless you tackle it on your own. The primary vorpal repo is basically unmaintained at this point. There is a “reforge” that’s going on here: |
event vorpal.on('vorpal_exit') 👍🏻 |
Really enjoying using Vorpal so far! Thank you guys for making such an awesome library happen.
One thing I'm trying to chase down is how to gracefully quit an app I'm working on. I'm emulating a virtual real-world device that does a thing on an interval. When I ctrl-c ctrl-c to exit that device, that interval keeps going and I'm forced to kill node directly as it keeps going forever. I'd like to be able to cancel that and any other async action that may be pending in an exit function.
I couldn't find any events to listen in to for this, and using the API for process itself seems a bit more haphazard than I'd like.
Any plans for this? Elegant workarounds?
The text was updated successfully, but these errors were encountered: