The reason for not connecting is _root = "wss://websocket.kite.trade/" value in web-socket class , after updating it to _root = "ws://websocket.kite.trade/" it is working fine.
Now I'm getting the the streaming data but it is executing in infinite loop ,can you help me in how to break this loop after some time and store the values instead of printing ?
# Infinite loop on the main thread. Nothing after this will run. # You have to use the pre-defined callbacks to manage subscriptions. kws.connect()
Im able to see the streaming data now but its going infinite loop.
How can store the streaming data and use it for mylogic as it is running in infinite loop ? Can you please help me in understanding "You have to use the pre-defined callbacks to manage subscriptions." so that I can change my code accordingly.
When you start the server it runs in infinite loop and blocks the main thread just like a web server so you have to write logic in your on_tick callback function to store the data.
Any solution for this?
Thanks,
Naveen
on_connect
callback to wait for the connection to establish.The reason for not connecting is _root = "wss://websocket.kite.trade/" value in web-socket class , after updating it to _root = "ws://websocket.kite.trade/" it is working fine.
Now I'm getting the the streaming data but it is executing in infinite loop ,can you help me in how to break this loop after some time and store the values instead of printing ?
Thanks,
Naveen
your help on this would be highly appreciated.
Thanks,
Naveen
You should pass the param
disable_ssl_verification=True
to the.connect()
method.The issue is due to a bug in OpenSSL itself -- https://github.com/liris/websocket-client/issues/35
The actual solution would be to update OpenSSL itself.
For reference check this thread - https://kite.trade/forum/discussion/comment/1431/
Can you help me in understanding below.
# Infinite loop on the main thread. Nothing after this will run.
# You have to use the pre-defined callbacks to manage subscriptions.
kws.connect()
Im able to see the streaming data now but its going infinite loop.
How can store the streaming data and use it for mylogic as it is running in infinite loop ?
Can you please help me in understanding "You have to use the pre-defined callbacks to manage subscriptions." so that I can change my code accordingly.
Thanks,
Naveen
on_tick
callback function to store the data.If you would like to subscribe for more scrips on run time you can check this thread - https://kite.trade/forum/discussion/comment/1880/#Comment_1880