Skip to content

Vrekrer/threading_decorators

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

threading_decorators

Decorators for easy threading in Python

Usage

Use Threaded_Function as a decorator for any function

import threading_decorators as ThD

@ThD.Threaded_Function
def foo(my_arg, my_keyword_arg=100):
    # Do something
    print(my_arg)
    for i in range(my_keyword_arg):
        # Do something else
        ThD.check_stop()
    print(i)

Then call the function to rut it inside a Thread

foo('Test')

if check_stop() where used inside the function, then calling the stop method will stop the execution of the function at the next check_stop() point

foo.stop()

About

Decorators for easy threading in Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages