Threading for human.
Some of main features:
- Support pause/unpause
- Support termination thread non-preemtively
You can install xthread from PyPi
$ pip install xthread
import time
from xthread import Thread
def target(executor):
print("Running...")
time.sleep(1)
thread = Thread(target)
# Running...
# Running...
thread.pause()
thread.unpause()
# Running...
# Running...
thread.stop()