Websocket api not running in background

Looked and the documentation and was successfully able to subscribe for quote update events for a particular stock.

The handler gets called appropriately and I'm able to retrieve the ltp.

But what im noticing is the handler seems to get called and not giving control to the main program.....

 

def custom_message(self):

         print LTP

 

# main program

subscribe to events ()

while True

     print("infinite print in main program")

     sleep (1)

 

The print statement inside the infinite while loop is not printing.....but the ltp in the handler 

is printing prompt with the latest price.

 

Should i be setting any flag to make it non blocking ?

 

 

 

 

 

 

5 replies