Websocket is very frequently disconnected

nikhil154
Hi guys , websocket is frequently getting disconnected . And i have to restart the kernel again and again to get the program back running. I am subscribing only 6 -10 option instruments. I believe that is not a lot . Can some one help me solve this problem , no body likes restarting every 2 minutes. Or is there something that can restart the kernel automatically? Please someone help ...
  • sujith
    pykiteconnect supports reconnect feature. You can check out here.

    But the real fix would be finding why is it disconnecting. Are you sure you are not blocking the main thread while you are processing the ticks?
  • sidverm
    Hi Sujit, I am facing the same problem. Can you tell us what is the right way to not block the main thread while processing the ticks?

    I am simply letting on_tick() do its processing on every time. It so turns out that processing (for about 20 instruments) takes about 350 ms while ticks come on an average after 600ms. But sometimes the processsing takes longer (even > 1 second). I am not doing anything special to take care of those situations. What happens on default if one does nothing. And what is the right way to handle this my using threading?
Sign In or Register to comment.