So, I have a code that waits for X to happen, then create a stream and process the Email.
What I'm looking for is a way for the code to continue to wait for X, although processEmail happens on a different thread, but currently the code is just waiting for the thread to finish before waiting for X to happen again.
if X happens:
thread = Thread(target = processEmail.main())
thread.start()
EDIT: FYI I have nothing that requires processEmail.main () to exit further down the code, so I don't have to wait for it to exit.
ANSWER Courtesy of Jean: Remove () after main.
source
share