-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Allow the ‘forceKillAfterTimeout’ option to be passed to ‘.cancel()’ #511
Comments
We are not going to add more to |
@sindresorhus Oh, that’s good to know. Thank you very much for the answer. Two follow-up questions:
|
|
Please consider #512 |
There is a good point raised in this issue: we have a graceful termination feature, which is pretty useful, and can be controlled with the
I would suggest the following solution: move the const childProcess = execa('...')
childProcess.kill('SIGTERM', {forceKillAfterTimeout: 2000}) To the process instantiation instead. const childProcess = execa('...', {forceKillAfterTimeout: 2000})
childProcess.kill() This would enable the other features to use it. I do not think there is a strong use case for allowing different timeout values for different On the other hand, there is a use case for a parent process to terminate a child process sometimes gracefully, sometimes not. But that can be done by using different signals. const childProcess = execa('...', {forceKillAfterTimeout: 2000})
const killSignal = graceful ? 'SIGTERM' : 'SIGKILL'
childProcess.kill(killSignal) What do you think @sindresorhus? |
Agreed 👍 |
What are your thoughts on taking that opportunity to rename that option to |
|
That's right. An actual graceful exit would be not to use What about |
|
|
This feature has been just released in Execa 9.0.0. Please see (and share!) the release post and the changelog. |
The documentation says we should prefer
.cancel()
over.kill()
, so it would be nice for.cancel()
to accept theforceKillAfterTimeout
option that.kill()
has.The text was updated successfully, but these errors were encountered: