Themes or background processes in the Google App Engine (GAE)

I am running a message and need a quick response. Therefore, I wanted the employee to perform some operations in the background and respond imidiatly to the request.

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

How can i do this? Is there any module that supports this in the Google App Engine api?

Edit:

In python

+4
source share
2 answers

Yes. You want to use the task queue API . He does exactly what you need.

+9
source

There is now thread support for python 2.7.

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

If you need a long worker thread, it will have to live in the backend, but if you want the thread for the entire service life of the request to synchronize your operations and speed up, now you can use real threads (just be careful that the interface threads are killed upon completion of the HTTP request).

+1
source

Source: https://habr.com/ru/post/1307056/


All Articles