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

Listen for script exit, and close processes #87

Open
ebebbington opened this issue Oct 24, 2021 · 0 comments · May be fixed by #145
Open

Listen for script exit, and close processes #87

ebebbington opened this issue Oct 24, 2021 · 0 comments · May be fixed by #145

Comments

@ebebbington
Copy link
Member

Summary

What:

Using signals, listen for if the user exits the script using CTRL+C or CMD+C, and if so, close the processes

Why:

Say something hangs, the user is going to CTRL+C to close it - this means Sinco won't be able to close the subprocess, leading to zombie processes running on the users computer. If the user does this 3 times for chrome, they can have 15 zombie processes running

How:

Wait for denoland/deno#12512, also add a duration param to all api methods, that is passed to the sendWebsocketMessage method, for example

sendWSMessage(...) {
  ...
  const intervalId = setTinterval(async () => {
    count++
    if (count === duration) await this.done("Took too long")
  })
  await messagePromise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants