How to use the evasdk.ws_connect function in evasdk

To help you get started, we’ve selected a few evasdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github automata-tech / eva_python_sdk / examples / http_ws_example.py View on Github external
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)