MCPcopy Create free account
hub / github.com/dot-agent/nextpy / emit_update

Method emit_update

nextpy/app.py:1078–1088  ·  view source on GitHub ↗

Emit an update to the client. Args: update: The state update to send. sid: The Socket.IO session id.

(self, update: StateUpdate, sid: str)

Source from the content-addressed store, hash-verified

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.

Callers 3

on_eventMethod · 0.95
modify_stateMethod · 0.80
_coroMethod · 0.80

Calls 1

jsonMethod · 0.80

Tested by

no test coverage detected