Commit ad1fcb9
committed
refactor: fold post_writer signaling closes into async with
Both post_writer tasks (sse, streamable_http) used a try/finally to
close signaling stream ends after the loop. Since the except handlers
only log and don't touch those streams, the closes can move into the
existing async with header — __aexit__ runs before except, which is
fine when the handler doesn't send on the closed stream.
sse_reader can't do the same: its except Exception handler sends on
read_stream_writer (L120), so it must stay open until after the
handler runs.1 parent 473a678 commit ad1fcb9
2 files changed
+2
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | 141 | | |
144 | 142 | | |
145 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
443 | | - | |
| 443 | + | |
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
| |||
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | 483 | | |
487 | 484 | | |
488 | 485 | | |
| |||
0 commit comments