magiskboy / xthread

Thread for human

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xthread

Threading for human.

Build Status Download PyPi MIT Py version PyPi version

Features

Some of main features:

  • Support pause/unpause
  • Support termination thread non-preemtively

Installation

You can install xthread from PyPi

$ pip install xthread

Usage

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()

About

Thread for human

License:MIT License


Languages

Language:Python 82.4%Language:Shell 17.6%