Kotak-Neo / kotak-neo-api

96 stars 80 forks source link

All the scripts getting unsubscribed when trying to unsubscribe one script #99

Open Rahulsoni0302 opened 7 months ago

Rahulsoni0302 commented 7 months ago

@Kotak-Neo

I have subscribed to some tokens

inst_token1 = [{"instrument_token": "26009", "exchange_segment": "nse_cm"}] t1 = threading.Thread(target= client.subscribe , args=(inst_token1,)) t1.start()

and after some time subscribed to another one

inst_token2 = [{"instrument_token": "58274", "exchange_segment": "nse_fo"}]

Get live feed data

client.subscribe(instrument_tokens=inst_token2)

now when i tried to unsubscribe the second script using

Shared.client.un_subscribe(instrument_tokens=inst_token2)

i'm getting the response like this :

The Data has been Un-Subscribed [Res]: Un-Subscribed Successfully!

but ideally i should be getting the response for the token no. 26009

help me .

aswinm227 commented 7 months ago

i use client.quote in a while loop : )

Rahulsoni0302 commented 7 months ago

i use client.quote in a while loop : )

@aswinm227 bro i tried your solution but still websocket connection is getting disconnected. Thanks for you help : )