Metadata-Version: 2.0
Name: sine.threads
Version: 0.1.4
Summary: stoppable and restartable thread simply using an event
Home-page: https://github.com/SineObama/
Author: Xian Zheng
Author-email: 714186139@qq.com
License: MIT
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=2.7.0
Description-Content-Type: text/markdown

# Example

```python
from sine.threads import *

def func(stop_event):
	while 1:
		if stop_event.is_set():
			break
		# do your work

thread = StoppableThread(target=func)
thread.start()
# ...
thread.stop()
# thread.stopped() == True
thread.join()


thread = ReStartableThread(target=func, event_name='stop_event') # can specify the parameter's name
thread.start()
# ...
thread.stop()
thread.join()
# ...
thread.start()
# ...
thread.stop()
thread.join()
# ...
```


# Changelog

#### v0.1.4, 2018-6-7

* ReStartableThread support join the old thread instance  
* fix: ReStartableThread.start always creates new instance  
* *improve comment and change to English*  
* *change directory structure and update setup.py*  
* *add tests.py*  


