I am using web.py to return a protocol buffer response from a post request and response time is critical. I have some writes to redis that I would like to do after the post response. rather than before.
r = redis.StrictRedis(host='localhost', port=6379, db=0)
class index:
def POST(self):
return pPbuffer
r.set('a','b')
So, how can I modify the code so I can I can return as quickly as possible but doing post cleanup (no pun intended).
Thanks
If you are using wsgi or something as server you could use yield to generate contents time after time and the browser will receive them in sort.
For your example:
And this is a good example which is doing it this way.