Commit 25fa21a
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 84ae422 commit 25fa21a
2 files changed
Lines changed: 20 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
471 | 476 | | |
472 | 477 | | |
473 | 478 | | |
474 | 479 | | |
475 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
476 | 483 | | |
477 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
478 | 491 | | |
479 | 492 | | |
480 | | - | |
481 | | - | |
482 | | - | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
483 | 496 | | |
484 | 497 | | |
485 | 498 | | |
| |||
2343 | 2356 | | |
2344 | 2357 | | |
2345 | 2358 | | |
2346 | | - | |
2347 | | - | |
2348 | | - | |
| 2359 | + | |
2349 | 2360 | | |
2350 | 2361 | | |
2351 | 2362 | | |
| |||
| 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