Use a promise to communicate between threads instead.