Package: corun
corun=====Acknowledgements----------------I'd like to acknowledge that without the work previously done by**David Beazey** I probably wouldn't have such a great starting point for writingthis module. I started writing corun after going through his presentation found[here](http://www.dabeaz.com/coroutines/). From which I drew quite a bit of thescheduler work done in **corun**. There were a few things I decided to dropyield trampolining from the **corun** module because I found that it complicatedthe code more (resulting in some performance issues that I couldn't easilysolve) as well as it didn't give the end module user the full control of whenhis/her coroutine wanted to give time for the scheduler to schedule in moreworkers. I also decided to add a few new notions which included the ability toput coroutines to sleep for sometime and came up with a solution similar to thesolution presented by David on how to make a task wait for another task toterminate.Introduction------------**corun** is a coroutine based Python library that uses only built-in Pythonfeatures to provide a low-level event driven programming model to be used whenyou can't scale a very common thread based approach to 10K+ concurrentlyrunning threads. Its also the case that the tasks being done by those threads isprimarily I/O bound and not CPU bound as at that point the coroutine approachmay not perform as well as a regular threaded model.There are a few other "similar" libraries out there such as gevent and cogen,but I found that gevent tried to hide the exact points at which your coroutinewas "yielding" to the scheduler. Cogen was closer to what I wanted but I didn'tsee why it needed you to decorate your coroutines with the **@coro** decoratorand their google code project hasn't been touched in 2 years and even pip oreasy_install couldn't find some dependencies when trying to install. So I'massuming that the code is unmaintained and an abadoned project at this point.Requirements------------* Python 2.5+Installation------------pip install -e git+git://github.com/rlgomes/corun.git#egg=corunUsage Examples--------------For examples have a look at the tests folder. I will add more samples to thisREADME in the near future which will describe different ways of using corun.Performance Stats-----------------You can easily run the built-in tests by issuing:python setup.py teston a freshly checked out copy and you'll get results similar to the following:test_corun (tests.concurrent_task_test.ConcurrenTaskTest) ...corun time:	0.269580 10000oktest_gevent (tests.concurrent_task_test.ConcurrenTaskTest) ...gevent time:	0.497005 10000oktest_thread (tests.concurrent_task_test.ConcurrenTaskTest) ...thread time:	1.338474 10000oktest_corun (tests.io_task_test.IOTaskTest) ...corun time:	0.289584 100oktest_gevent (tests.io_task_test.IOTaskTest) ...gevent time:	3.748089 100oktest_thread (tests.io_task_test.IOTaskTest) ...thread time:	1.230650 100okStarting tests in 3 seconds...concurrent connection limit is 2048listening at localhost:9999test_1_thread (tests.urlfetch_test.URLFetchTest) ...thread time:	4.171722 1000oktest_2_corun (tests.urlfetch_test.URLFetchTest) ...corun time:	0.450275 1000oktest_3_gevent (tests.urlfetch_test.URLFetchTest) ...gevent time:	0.489684 1000ok----------------------------------------------------------------------Ran 9 tests in 17.363sOKThe results of my tests are pretty impressive but I realize this library stillneeds a few features and may certainly have situations where it does notoutperform the other two approaches.