def begin(queue, event=None):
signal.signal(signal.SIGINT, sigint_handler)
signal.signal(signal.SIGTERM, sigterm_handler)
load(queue)
start()
try:
while True:
signal.pause()
except AttributeError:
# signal.pause() not implemented on windows
# while not event.is_set():
while not event:
time.sleep(1)
print('event was set, stopping')
stop()
评论列表
文章目录