Let's revive from Ctrl-C or any exception!
The code of 01_consume_queue.py:
from time import sleep
from revivalkit import revive
o = revive()
if not hasattr(o, 'que'):
o.que = list(range(10))
print('current que: ', o.que)
while o.que:
sleep(0.25)
print('consumed', o.que.pop())
pip install revivalkit
It supports both Python 2 and Python 3.
I'm still working on it. Please read the examples or just the source code.
Thanks uranusjr and ypsun's help at Taipei.py Projects On. :D