| 55 | |
| 56 | |
| 57 | async def _single_outgoing_loop( |
| 58 | layout: LayoutType[LayoutUpdateMessage, LayoutEventMessage], send: SendCoroutine |
| 59 | ) -> None: |
| 60 | while True: |
| 61 | update = await layout.render() |
| 62 | try: |
| 63 | await send(update) |
| 64 | except Exception: # nocov |
| 65 | if not REACTPY_DEBUG_MODE.current: |
| 66 | msg = ( |
| 67 | "Failed to send update. More info may be available " |
| 68 | "if you enabling debug mode by setting " |
| 69 | "`reactpy.config.REACTPY_DEBUG_MODE.current = True`." |
| 70 | ) |
| 71 | logger.error(msg) |
| 72 | raise |
| 73 | |
| 74 | |
| 75 | async def _single_incoming_loop( |