[Twisted-Python] Example of a long-polling asynchronous web servic?
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
> 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...
More information about the Twisted-Python