Thanks folks.
@bruce - fantastic library! how i wish i could use it, since
Websockets are way more appropriate for the task in hand. however,
that's not how the websockets folks rolled in this case. I'm going to
suggest they do so. In the interim, I will be using your that library
for another project of mine, as the API is way nicer than the google
reference implementation. Thanks.
@ralf - your tip was the clue I needed.
For future travellers down this path, i think my confusion was twofold
- firstly the jquery library seems not to recycle ajax objects per
default. (Is that even possible? My browser-fu is weak) Secondly, the
webchat example, and indeed the stream-web example (
http://blog.gevent.org/2009/12/05/more-comet-with-gevent/ ) use django
HttpResponse objects which AFAICT don't care like streaming. So I had
at last to dive into the WSGI spec and work out how that stuff works.
and the answer is returning an iterator.
http://www.python.org/dev/peps/pep-0333/#buffering-and-streaming
That was far, far simpler than I expected. all i have to do is yield
from my data source in the application function passed to the
WSGIServer instance. This is now working, and I'll post the code up
here the moment it does anything useful
Cheers
Dan
> >
http://blog.gevent.org/2009/10/10/simpler-long-polling-with-django-an...
> > ) looks like it might be a nice start. However, I'm having trouble
> > making the example work for my use case. in particular, I don't want
> > my comet server to close the HTTP response, but rather to stream data
> > to it gradually without closing said connection. (this is required by
> > the specification I'm working to -
>
> >
http://wiki.gephi.org/index.php/Specification_-_GSoC_Graph_Streaming_...