Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def eva_ws_example(host_ip, session_token):
websocket = await evasdk.ws_connect(host_ip, session_token)
msg_count = 0
time_since_msg = time.time()
while True:
ws_msg_json = await websocket.recv()
print('WS msg delta T: {}, number: {}'.format(time.time() - time_since_msg, msg_count))
msg_count += 1
time_since_msg = time.time()
ws_msg = json.loads(ws_msg_json)
print(ws_msg)