[Twisted-Python] Example of a long-polling asynchronous web servic?

Glyph Lefkowitz glyph at twistedmatrix.com
Tue Oct 6 23:46:43 EDT 2009

On Tue, Oct 6, 2009 at 11:30 PM, Stephen Mattison <stephenmattison at gmail.com
> wrote:

> How can I implement this in Twisted?

You can use DeferredResource:


or you can return NOT_DONE_YET from Resource.render(), and hold on to the


to leave the connection open until something happens.

For a more elaborate example of a long-polling server component, you could
see Nevow's Athena:


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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20091006/d6c7dfd8/attachment-0001.htm 

More information about the Twisted-Python mailing list