It looks like you're new here. If you want to get involved, click one of these buttons!
def on_tick(tick, ws):
print tick
ws.close()
# Callback for successful connection.
def on_connect(ws):
ws.subscribe(tokens)
ws.set_mode(ws.MODE_FULL, tokens)
kws.on_tick = on_tick
kws.on_connect = on_connect
kws.connect(disable_ssl_verification=True) #im using UBUNTU
Regards,
You need to call stop_retry and then close connection.
As you suggested ,I tried with below code .
def on_ticks(ws, ticks):
# Callback to receive ticks.
print(ticks)
ws.stop_retry()
ws.close()
but thread is not closing even after that ,but I can see its not trying to connect again and again.
Regards,
Naveen
From above example, please guide me how i can close the connection properly after receiving 1 tick? some example please..
You need to call close() method. You can check out python documentation.
Inside on_close() you need to call stop as mentioned by @vivek.
builtins.AttributeError: 'KiteTicker' object has no attribute 'stop'