Commit f6adebd
committed
net: use throwIfAborted and improve server iteration example
Address review feedback on the net/promises API:
- Use `signal.throwIfAborted()` for the pre-connect and pre-listen abort
checks instead of constructing an AbortError by hand.
- Update the `server[Symbol.asyncIterator]()` documentation example to
dispatch each connection to a separate async task, with a note that
awaiting inline serializes connections.
Refs: #21482
Assisted-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Ethan Arrowood <ethan@arrowood.dev>1 parent 9885d70 commit f6adebd
2 files changed
Lines changed: 20 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
466 | 471 | | |
467 | 472 | | |
468 | 473 | | |
469 | 474 | | |
470 | | - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
471 | 478 | | |
472 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
473 | 486 | | |
474 | 487 | | |
475 | | - | |
476 | | - | |
477 | | - | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
478 | 491 | | |
479 | 492 | | |
480 | 493 | | |
| |||
2186 | 2199 | | |
2187 | 2200 | | |
2188 | 2201 | | |
2189 | | - | |
2190 | | - | |
2191 | | - | |
| 2202 | + | |
2192 | 2203 | | |
2193 | 2204 | | |
2194 | 2205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 26 | + | |
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
| |||
49 | 46 | | |
50 | 47 | | |
51 | 48 | | |
52 | | - | |
53 | | - | |
54 | | - | |
| 49 | + | |
55 | 50 | | |
56 | 51 | | |
57 | 52 | | |
| |||
0 commit comments