Hi , I am using the below code. Here "on_ticks" loop is executing only once . After that my connection is getting closing. Can any one please let me know what is wrong in the code.?
def on_ticks(ws,ticks):
def on_connect(ws, response): ws.subscribe(Tokens) ws.set_mode(ws.MODE_FULL,Tokens) def on_close(ws, code, reason): # On connection close stop the main loop # Reconnection will not happen after executing `ws.stop()` ws.stop()
You need to remove
ws.stop()
, as it gets called at end of each execution and closes the connection.