Improve Interruption Handling (#134)

* Clear websocket queue on interrupt

* add code
This commit is contained in:
Freddy Boulton
2025-03-06 13:42:56 -05:00
committed by GitHub
parent a0b46f4059
commit 8f6287cea3
4 changed files with 45 additions and 10 deletions

View File

@@ -509,7 +509,7 @@ class Stream(WebRTCConnectionMixin):
handler.phone_mode = True
async def set_handler(s: str, a: WebSocketHandler):
if len(self.connections) >= self.concurrency_limit:
if len(self.connections) >= self.concurrency_limit: # type: ignore
await cast(WebSocket, a.websocket).send_json(
{
"status": "failed",
@@ -532,7 +532,7 @@ class Stream(WebRTCConnectionMixin):
handler.phone_mode = False
async def set_handler(s: str, a: WebSocketHandler):
if len(self.connections) >= self.concurrency_limit:
if len(self.connections) >= self.concurrency_limit: # type: ignore
await cast(WebSocket, a.websocket).send_json(
{
"status": "failed",