Today @ 15:15 (3.15 PM) rates are hanged for 5-7 minutes . at same time rates are hanged in your kite.zerodha.com and mobile app also.. same also happened in past lots of times ..
so i wants to know that if your web-socket or rates are hanged then can i get any flag like rates or server is running or not with rest API??
i mean to say i wants to know that whether your web-socket server is on or off.
because at that time i am getting wrong signals in application.
Whenever you receive a tick write into Redis with a key connection_alive with value 1 and TTL 1 second or whatever x seconds interval you want
SET connection_alive 1 x
At anytime, If you check this key in Redis and you find that it is not present, it means no data has come in it at least for the last x seconds. Please note my statement
I am sorry if i am wrong. But as far as knowing about websocket connection liveness. Isn`t that already implemented via
heartbeats ( reconnection feature ).
even if no tick is incoming. kite server is sending heartbeats.
and when there is no heartbeat. for 5 seconds ( this could be altered ). reconnection is attempted at least that is how it is in c#.
I dont know python. so i cant say much. but i think ping pong is doing the same thing in python too. So everytime a reconnect is attempted it is understood that previous connection has failed/notworking or out of phase. capturing of on_reconnect. would tell you the status of your connection. but this is python so i could be wrong.
which leaves us with your original query
how to know if Kite ticker server is down/freezed or not?
I would say we cannot!, for sure. Unless kite itself provides an api to inquire. As rightly pointed out by you, via some api call. which could be a http call. like IsWebsocketWorking
Because every other way is a guess. how do we know
if it is Kite ticker server that is down
or something is wrong with our internet connection.
some process within our computer has made our system to be unavailable to other proccesses. for few seconds.
or some data-center node enroute to kite ticker server from our location has malfunctioned.
where as calling IsWebsocketWorking would bring us close to reasonable certainty.
Althou when websocket freezes. we know it automatically that something has gone wrong. where!, is the suspense part.
on_ticks
Whenever you receive a tick write into Redis with a key connection_alive with value 1 and TTL 1 second or whatever x seconds interval you want
SET connection_alive 1 x
At anytime, If you check this key in Redis and you find that it is not present, it means no data has come in it at least for the last x seconds. Please note my statement
no data has come for last >= x seconds
But as far as knowing about websocket connection liveness.
Isn`t that already implemented via
for 5 seconds ( this could be altered ).
reconnection is attempted at least that is how it is in c#.
but i think ping pong is doing the same thing in python too.
So everytime a reconnect is attempted it is understood that previous
connection has failed/notworking or out of phase. capturing of
on_reconnect. would tell you the status of your connection.
but this is python so i could be wrong.
which leaves us with your original query
Unless kite itself provides an api to inquire.
As rightly pointed out by you, via some api call. which
could be a http call. like IsWebsocketWorking
Because every other way is a guess. how do we know
to reasonable certainty.
Althou when websocket freezes. we know it automatically that something has gone wrong.
where!, is the suspense part.
Thanks
Regards