Commit 54e1f76
authored
fix(listener): handle shutdown during realtime audio and await control sends (#1878)
- Prevent blocking when initiating realtime audio by selecting on a
shutdown receiver. If shutdown is triggered while calling
client.from_realtime_audio, return early instead of awaiting
indefinitely. This is added in two places where outbound streams are
created. - Unify result handling by matching on the selected result
(res) and preserve existing error reporting when from_realtime_audio
fails. - Make control message forwarding asynchronous: replace try_send
with awaitable send calls so control messages are properly delivered
to mic and speaker channels.
- - Ensure graceful stream termination by sending shutdown signals to
c and speaker shutdown channels when the inbound stream ends.
- These changes improve responsiveness to shutdown and ensure control
- ssages
are reliably forwarded.1 parent 609c121 commit 54e1f76
1 file changed
+22
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
263 | 271 | | |
264 | 272 | | |
265 | 273 | | |
| |||
296 | 304 | | |
297 | 305 | | |
298 | 306 | | |
299 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
300 | 316 | | |
301 | 317 | | |
302 | 318 | | |
| |||
448 | 464 | | |
449 | 465 | | |
450 | 466 | | |
451 | | - | |
452 | | - | |
| 467 | + | |
| 468 | + | |
453 | 469 | | |
454 | 470 | | |
| 471 | + | |
| 472 | + | |
455 | 473 | | |
456 | 474 | | |
457 | 475 | | |
| |||
0 commit comments