Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Threads or background processes in Google App Engine (GAE)

I'm running a post, and need the request to be replied fast. So I wanted to put a worker running some operations in background and reply the request imidiatly.

The worker is always finite in operations and executes in [0;1] second

How can I do this? Is there any module that suports this in the google app engine api?

Edit:

In python

like image 324
fmsf Avatar asked Dec 28 '22 20:12

fmsf


2 Answers

Yes. You want to use the Task Queue API. It does exactly what you need.

like image 193
Peter Recore Avatar answered Dec 31 '22 10:12

Peter Recore


There is now threading support for python 2.7.

https://developers.google.com/appengine/docs/python/backends/overview#background_threads

If you want a long-running worker thread, it will have to live in a backend, but if you want a thread for the lifetime of the request to asynchronize your operations and boost speed, you can now use real threads (just beware that frontend threads are killed when the http request is over).

like image 25
Ajax Avatar answered Dec 31 '22 09:12

Ajax