Popular recipes by Nick Faro http://code.activestate.com/recipes/users/4184363/2013-06-01T18:20:15-07:00ActiveState Code RecipesAsyncGetter (Python)
2013-06-01T18:20:15-07:00Nick Farohttp://code.activestate.com/recipes/users/4184363/http://code.activestate.com/recipes/578540-asyncgetter/
<p style="color: grey">
Python
recipe 578540
by <a href="/recipes/users/4184363/">Nick Faro</a>
(<a href="/recipes/tags/asynchronous/">asynchronous</a>, <a href="/recipes/tags/getting/">getting</a>).
</p>
<p>You specify it a 'get' function and it runs a thread and gets it for you. Incredibly simple.</p>
WebSocket interface (Python)
2012-11-25T16:52:21-08:00Nick Farohttp://code.activestate.com/recipes/users/4184363/http://code.activestate.com/recipes/578348-websocket-interface/
<p style="color: grey">
Python
recipe 578348
by <a href="/recipes/users/4184363/">Nick Faro</a>
(<a href="/recipes/tags/javascript/">javascript</a>, <a href="/recipes/tags/network/">network</a>, <a href="/recipes/tags/socket/">socket</a>, <a href="/recipes/tags/websocket/">websocket</a>).
Revision 2.
</p>
<p>This tries its best to be a replacement for the regular <code>socket</code> module.</p>
<p>It supports only sending and receiving but should be useful enough.</p>
<p>The only real difference should be that you can't specify the number of bytes is received, instead do</p>
<pre class="prettyprint"><code>for message in socket.recv():
print(message)
</code></pre>
<p>Revision 2:
Added proper message receiving. Previously it just requested a ton of data. Now it reads 2 bytes, determines the length, then requests that much.</p>