Kotak-Neo / kotak-neo-api

96 stars 80 forks source link

Update orderfeed websocket to accept function as arguments #85

Closed mayank408 closed 7 months ago

nbharadvajdatamatics commented 8 months ago

@mayank408 Can you please provide us some description that why do we need to accept function as arguments in subscribe_to_orderfeed function? Since him_connection has already on_message, on_close and on_error function and that is returning the necessary details.

rosevinod commented 8 months ago

@mayank408 @Kotak-Neo There is a bug in subscribe_to_orderfeed function, it does not return anything to the user.

We need to change subscribe_to_orderfeed function because Kotak on_message doesn't return anything.

Order Feed change

-----neo_api.py-----

subscribe_to_orderfeed(self,on_message)
hsm_connection(on_message=on_message)

-----NeoWebSocket.py------

def hsm_connection(self, url, token, sid, server_id,on_message):
self.hsw.open_connection(url=url, onopen=self.on_open, onmessage=on_message,
def on_message(self, message):  
print("INTO ON Message", message)  
on_message(message)
1513janakbarman commented 7 months ago

19880