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

Rework signal handling #477

Closed
saghul opened this issue Apr 9, 2024 · 1 comment
Closed

Rework signal handling #477

saghul opened this issue Apr 9, 2024 · 1 comment

Comments

@saghul
Copy link
Owner

saghul commented Apr 9, 2024

  • Add some addSignalListener / removeSignalListener a la Deno
  • Ignore SIGPIPE
  • Don't expose signal handling APIs to workers
saghul added a commit that referenced this issue Apr 9, 2024
Replace the current signal API with one following a similar model to
EventTarget, a la Deno.

Before

```
const sh = tjs.signal('SIGINT', handleSigInt);
// sh needs to be alive or the signal handler is destroyed.
```

After

```
tjs.addSignalListener('SIGINT', handleSigInt);
// No need to use a handle, it can be removed with
// tjs.removeSignalListener.
```

Fixes: #476
Ref: #477
saghul added a commit that referenced this issue Apr 9, 2024
Replace the current signal API with one following a similar model to
EventTarget, a la Deno.

Before

```
const sh = tjs.signal('SIGINT', handleSigInt);
// sh needs to be alive or the signal handler is destroyed.
```

After

```
tjs.addSignalListener('SIGINT', handleSigInt);
// No need to use a handle, it can be removed with
// tjs.removeSignalListener.
```

Fixes: #476
Ref: #477
saghul added a commit that referenced this issue Apr 9, 2024
saghul added a commit that referenced this issue Apr 9, 2024
Replace the current signal API with one following a similar model to
EventTarget, a la Deno.

Before

```
const sh = tjs.signal('SIGINT', handleSigInt);
// sh needs to be alive or the signal handler is destroyed.
```

After

```
tjs.addSignalListener('SIGINT', handleSigInt);
// No need to use a handle, it can be removed with
// tjs.removeSignalListener.
```

Fixes: #476
Ref: #477
saghul added a commit that referenced this issue Apr 9, 2024
@saghul
Copy link
Owner Author

saghul commented Apr 9, 2024

Done in #480

@saghul saghul closed this as completed Apr 9, 2024
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

1 participant