File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ async def _process_ws_message(
254254 send_text : Callable [[str ], Any ],
255255 messages : list [str ],
256256 batch_delay : float ,
257- ) -> bool | None :
257+ ) -> bool :
258258 """Process a single WebSocket message from the queue.
259259
260260 Args:
@@ -264,28 +264,25 @@ async def _process_ws_message(
264264 batch_delay: Batch delay in seconds
265265
266266 Returns:
267- True to continue processing, False to stop the sender loop,
268- None to continue (same as True but used for continue semantics).
267+ True to continue processing, False to stop the sender loop.
269268 """
270269 timeout = batch_delay if messages else None
271270 try :
272271 msg = await asyncio .wait_for (q .get (), timeout = timeout )
273272 except asyncio .TimeoutError :
274- if not await _send_batched (send_text , messages ):
275- return False
273+ success = await _send_batched (send_text , messages )
276274 messages .clear ()
277- return True
275+ return success
278276
279277 if msg == SHUTDOWN_SIGNAL :
280278 if messages :
281279 await _send_batched (send_text , messages )
282280 return False
283281
284282 if msg == FLUSH_SIGNAL :
285- if messages and not await _send_batched (send_text , messages ):
286- return False
283+ success = not messages or await _send_batched (send_text , messages )
287284 messages .clear ()
288- return None
285+ return success
289286
290287 if not batch_delay :
291288 try :
You can’t perform that action at this time.
0 commit comments