cloudflare / cloudflare/workerd
Feature request: AbortSignal support via `signal` in `connect` TCP API
Open
feature request
- Dominant language
- C++
- Stars
- 8.7k
- Forks
- 739
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 174
Description
It would be awesome if `connect()` from `cloudflare:sockets` supported a `signal` for cleanup, timeouts, etc. It would make handling timeouts especially nice, like you can do with `fetch`:
```ts
fetch(url, {
...,
signal: AbortSignal.timeout(5000)
})
```
instead of a `Promise.race` or similar which is required today to effectively handle timeouts with `connect`.
Contributor guide
Assessment
This issue has not been assessed yet.