Skip to content

Commit

Permalink
Refactor WebSocket client storage in MockRobot class
Browse files Browse the repository at this point in the history
  • Loading branch information
sjev committed May 7, 2024
1 parent cd16789 commit e1a5534
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/jupyter_ui/data_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ async def send_data(self) -> None:
"theta": round(self.theta, 3),
}
msg = json.dumps(data)
await asyncio.gather(*(client.send(msg) for client in self.clients))

websockets.broadcast(self.clients, msg)
log.info(f"Sending data: {msg}")
await asyncio.sleep(1.0 / UPDATE_RATE)

Expand Down

0 comments on commit e1a5534

Please sign in to comment.