def main(): tasks = [ Producer(), ] for t in tasks: t.start() time.sleep(10) for task in tasks: task.stop() for task in tasks: task.join()