Skip to content

Listen for script exit, and close processes #87

Open
@ebebbington

Description

@ebebbington

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions