Skip to content

magiskboy/xthread

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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