make consumer run in a separate thread from main loop