<div class="gmail_quote">On Tue, Oct 6, 2009 at 11:30 PM, Stephen Mattison <span dir="ltr">&lt;<a href="mailto:stephenmattison@gmail.com">stephenmattison@gmail.com</a>&gt;</span> wrote:<br><div>  <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
How can I implement this in Twisted?<br></blockquote><div><br>You can use DeferredResource:<br><br>    <a href="http://twistedmatrix.com/documents/8.2.0/api/twisted.web.util.DeferredResource.html">http://twistedmatrix.com/documents/8.2.0/api/twisted.web.util.DeferredResource.html</a><br>
<br></div></div>or you can return NOT_DONE_YET from Resource.render(), and hold on to the request:<br><br>    <a href="http://twistedmatrix.com/documents/8.2.0/api/twisted.web.resource.Resource.html#render">http://twistedmatrix.com/documents/8.2.0/api/twisted.web.resource.Resource.html#render</a><br>
<br>to leave the connection open until something happens.<br><br>For a more elaborate example of a long-polling server component, you could see Nevow&#39;s Athena:<br><br>    <a href="http://www.divmod.org/trac/wiki/DivmodNevow/Athena">http://www.divmod.org/trac/wiki/DivmodNevow/Athena</a><br>
<br>This does not implement JSON-RPC or XML-RPC, but it has lots of code for managing the outstanding connection, which may give you some ideas.<br><br>-Glyph<br><br>