简体   繁体   中英

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

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

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM