Emit an update to the client. Args: update: The state update to send. sid: The Socket.IO session id.
(self, update: StateUpdate, sid: str)
| 1076 | pass |
| 1077 | |
| 1078 | async def emit_update(self, update: StateUpdate, sid: str) -> None: |
| 1079 | """Emit an update to the client. |
| 1080 | |
| 1081 | Args: |
| 1082 | update: The state update to send. |
| 1083 | sid: The Socket.IO session id. |
| 1084 | """ |
| 1085 | # Creating a task prevents the update from being blocked behind other coroutines. |
| 1086 | await asyncio.create_task( |
| 1087 | self.emit(str(constants.SocketEvent.EVENT), update.json(), to=sid) |
| 1088 | ) |
| 1089 | |
| 1090 | async def on_event(self, sid, data): |
| 1091 | """Event for receiving front-end websocket events. |
no test coverage detected