MCPcopy Index your code
hub / github.com/python-websockets/websockets / replay

Function replay

example/tutorial/step3/app.py:32–48  ·  view source on GitHub ↗

Send previous moves.

(websocket, game)

Source from the content-addressed store, hash-verified

30
31
32async def replay(websocket, game):
33 """
34 Send previous moves.
35
36 """
37 # Make a copy to avoid an exception if game.moves changes while iteration
38 # is in progress. If a move is played while replay is running, moves will
39 # be sent out of order but each move will be sent once and eventually the
40 # UI will be consistent.
41 for player, column, row in game.moves.copy():
42 event = {
43 "type": "play",
44 "player": player,
45 "column": column,
46 "row": row,
47 }
48 await websocket.send(json.dumps(event))
49
50
51async def play(websocket, game, player, connected):

Callers 2

joinFunction · 0.70
watchFunction · 0.70

Calls 2

copyMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…