[Twisted-Python] Example of a long-polling asynchronous web servic?
stephenmattison at gmail.com
Wed Oct 7 00:06:20 EDT 2009
Hey Glyph thanks for responding so promptly! First if I understand correctly
on the server-side we have some code like:
and on the client side
response = service.get_data_updates()
if response != NO_DATA: break
As far as I can tell doing this has NO guarantee that all messages are
delivered unless every server->client connection maintains a stack of "new"
messages, whereas in a message-brokered setting the server just keeps
sending "global" updates as they occur, and the broker guarantees that
clients will receive every one. Where as in this situation, since the client
is asking the server for updates, unless the server strictly maintains all
of the updates for a specific client, some of them might be thrown on the
Am I correct here?
On Tue, Oct 6, 2009 at 8:46 PM, Glyph Lefkowitz <glyph at twistedmatrix.com>wrote:
> 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.
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python