Most viewed recipes tagged "inline"http://code.activestate.com/recipes/tags/inline/views/2012-12-06T19:32:20-08:00ActiveState Code RecipesMulticontext (e.g. asynchronous) inline execution framework using coroutines (Python)
2012-12-06T19:32:20-08:00Glenn Eychanerhttp://code.activestate.com/recipes/users/4172294/http://code.activestate.com/recipes/576965-multicontext-eg-asynchronous-inline-execution-fram/
<p style="color: grey">
Python
recipe 576965
by <a href="/recipes/users/4172294/">Glenn Eychaner</a>
(<a href="/recipes/tags/asynchronous/">asynchronous</a>, <a href="/recipes/tags/coroutine/">coroutine</a>, <a href="/recipes/tags/decorator/">decorator</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/inline/">inline</a>, <a href="/recipes/tags/nonblocking/">nonblocking</a>, <a href="/recipes/tags/pattern/">pattern</a>, <a href="/recipes/tags/thread/">thread</a>).
Revision 14.
</p>
<p>A framework for executing inline code, contained in a generator, across multiple execution contexts, by pairing it with an executor that handles the context switching at each yield. An example of a generator which executes some iterations synchronously and some asynchronously is provided. The framework is general enough to be applied to many different coroutine situations.</p>