cloudflare / cloudflare/workerd

Feature request: AbortSignal support via `signal` in `connect` TCP API

Open
#5,432 2 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.