I went through the same in detail. However, I have only one query regarding the 2nd method explained by rakeshhr sir.
I have a main function in my code which I am keeping in on ticks () function.
" def on_ticks(ws,ticks): helper_method(ticks) main() " is the main() to be kept in the while loop on_ticks() as explained in threading method or below the logging.debug code? and if the same is to be placed in while loop on_ticks(), the whether the main function itself also need to be placed there? (below helper function)