Kotak-Neo / kotak-neo-api

120 stars 113 forks source link

Update orderfeed websocket to accept function as arguments #85

Closed mayank408 closed 1 year ago

nbharadvajdatamatics commented 1 year 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 1 year 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 1 year ago

19880