Skip to content

mountain3th/tconcurrent-tornado

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tconcurrent-tornado


Based on tornado's gen.coroutine decorator, everytime when we do some io operations(sleeping, readfile, socket..eta), we wrap it and yield a thread future.When the future is done,(is_done==True), the program continues.

Installation


python setup.py install

Usage


import tconcurrent

# must use wraps here
@tconcurrent.ThreadPoolRunner.wraps()
def get(self):
    # when do some io operations, yield with a toncurrent's task
    yield tconcurrent.ThreadPoolRunner.create_task(func1)

    yield tconcurrent.ThreadPoolRunner.create_task(func1)

    self.finish()

See more details in examples/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages