Discussion:
[bottlepy] background task
Rémi Bouhl
2016-06-27 15:48:09 UTC
Permalink
Hi.
I am trying to do a bottle app that would upload (possibly huge) files over
FTP, without getting stuck while uploading, and allowing the user to close
the app page while the upload is going on.

I work on apache2, with mod_wsgi.

I get stuck on the following : I can not return anything to the end user
while the upload is running.

I have tried to use gevent, but it doesn't work : gevent.joinall() does not
return anything until the uploading gevent is over.

In the attached code, I have tried to use "yield", as <
http://bottlepy.org/docs/dev/async.html > makes me think that "yield"
allows a bottle application to return something to user before the end of
functions. It doesn't work : nothing is shown on client side.

Is there a way to do the following in bottle ?
- get a file from a POST request,
- start uploading the file,
- send a message to user, saying one can close the web app, and keeping
uploading after the page has been closed,
- once upload is done, do some more stuff (send a email to user).

I am not looking for someone that would write it for me, just a hint to
"return" something on client side, while keeping doing stuff in background,
if this can be done with bottle.

Thanks.
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...