kws.connect(threaded=True) not working

saurabh3679
I store the ticks of a stock in a dataframe and pass this dataframe to a thread where it runs logic on dataframe to decide to place order or not.

As suggested in one of the discussions that I read, if I pass threaded=True to kws.connect, my script ends immediately.

But when I don't pass it and don't change kws.connect() script runs fine and thread also works..

why threaded=True didn't work as expected?
Tagged:
  • sujith
    Can you paste the complete stacktrace and code here?
  • zartimus
    @saurabh3679
    kws.connect(threaded=True) runs ticker in a separate thread
    That means you ll have to block the main thread in some way.

    If you need to process dataframe in a separate thread, you dont need to run ticker in threaded mode. Create a new thread inside on_ticks callback and process the ticks.
  • saurabh3679
    Thanks Zartimus. That solves the dilemma. I am storing the ticks in a dataframe, creating a new thread inside on_ticks and passing dataframe to this thread.
This discussion has been closed.