Hello everyone,
I'm trying to implement server-push functionality using "multipart/x-
mixed-replace" content type as following:
# in theory, this function should run forever or until connection is
closed
def generate_stream(boundary):
boundary = '\n%s\n' % boundary
yield boundary
# returns initial content, does not block
yield get_update(True)
yield boundary
while 1:
# wait for changes, can block for relatively long time
yield get_update()
yield boundary
...
def action(self):
resp = Response(mimetype='multipart/x-mixed-
replace;boundary=PartBoundary')
resp.content = generate_stream('PartBoundary')
return resp
I never get any response from above action. Moreover, even when I drop
connection to server that generator function keeps running. It seems
that Pylons never sends anything back to client until it gets full
content, which in that scenario would never happen. I tried to run
that application with both Paste#http and flup#fastcgi and result are
the same - nothing is being sent to client.
I saw few posts on similar subject but none of them had a solution.
Any help is greatly appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---