Popular recipes tagged "twisted" but not "heapq"http://code.activestate.com/recipes/tags/twisted-heapq/2012-01-20T09:48:27-08:00ActiveState Code RecipesAsync subprocess check_output replacement for Twisted (Python)
2012-01-20T09:48:27-08:00Alan Franzonihttp://code.activestate.com/recipes/users/4169882/http://code.activestate.com/recipes/578021-async-subprocess-check_output-replacement-for-twis/
<p style="color: grey">
Python
recipe 578021
by <a href="/recipes/users/4169882/">Alan Franzoni</a>
(<a href="/recipes/tags/check_output/">check_output</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/spawnprocess/">spawnprocess</a>, <a href="/recipes/tags/subprocess/">subprocess</a>, <a href="/recipes/tags/twisted/">twisted</a>).
</p>
<p>As any twisted user knows, the original python subprocess module can yield to interferences with twisted's own reactor - at least unless installSignalHandlers is false, which can lead to other consequences. </p>
<p>This recipe simulates a stripped down version of subprocess.check_output() which returns a deferred and is twisted friendly.</p>
Twisted Public Deferred (Python)
2009-12-08T09:47:16-08:00Alan Franzonihttp://code.activestate.com/recipes/users/4169882/http://code.activestate.com/recipes/576978-twisted-public-deferred/
<p style="color: grey">
Python
recipe 576978
by <a href="/recipes/users/4169882/">Alan Franzoni</a>
(<a href="/recipes/tags/deferred/">deferred</a>, <a href="/recipes/tags/twisted/">twisted</a>).
Revision 5.
</p>
<p>This small piece of code helps separating the "public" and "private" interface parts of deferred objects in Twisted.</p>
<p>Although it might not be really useful in production code, it is great for newcomers who are still learning the framework.</p>
How to use twisted pb FilePager (Python)
2009-04-30T05:20:09-07:00alex lavoro.propiohttp://code.activestate.com/recipes/users/4170029/http://code.activestate.com/recipes/576735-how-to-use-twisted-pb-filepager/
<p style="color: grey">
Python
recipe 576735
by <a href="/recipes/users/4170029/">alex lavoro.propio</a>
(<a href="/recipes/tags/filepager/">filepager</a>, <a href="/recipes/tags/network/">network</a>, <a href="/recipes/tags/pb/">pb</a>, <a href="/recipes/tags/twisted/">twisted</a>).
Revision 3.
</p>
<p>Banana limits string objects to 640k so sending a large file requires to break it into many small chunks. Twisted provide a helper class to do this: twisted.spread.pb.FilePager. I modified on <a href="http://code.activestate.com/recipes/457670/">recipe 457670</a>: "How to use twisted pb pager" to demonstrate the usage of FilePager. getFile1() is similar to getIt() in <a href="http://code.activestate.com/recipes/457670/">recipe 457670</a>. getFile2() uses the utility function in twisted.spread.pb.util.</p>