I don't think there is someting like a return -> do x thin in webpy, as a return statement ends the function call and I don't see how code execution after that would be possible in the same context. However there is an experimental module for longrunning jobs (http://webpy.org/cookbook/background?m=view), maybe this could help. You also could write another python script for handling the logrunning stuff and maybe pipe instructions trough a message Queue.
Am Montag, 26. Oktober 2015 17:18:22 UTC+1 schrieb Big Strong: > > Is there a asynchronous machanism of web.py which can firstly response > the user before timeout and then execute the time-costing task in > background without being interrupted? The situation is that I need to > trigger some time-costing task according to the users' post request > content, but I must return a result to the user within 5s. The result has > nothing to do with the task but just some reminding that the server has > accepted the request. So I believe I can just return the tips to the user > while continually run the task in background. How can I accomplish that > with web.py? > -- You received this message because you are subscribed to the Google Groups "web.py" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/webpy. For more options, visit https://groups.google.com/d/optout.
