The following is an excerpt from "The Infinite Machine"
In my previous article, I discussed the problems with Google App Engine’s
We need a decorator!
I’ve been using the deferred library since I started building python apps on Google App Engine. That is, I’ve been…medium.com
I promised to present a replacement, so here it is.
Use the @task decorator from
appenginetaskutils in your projects so that, unlike with
defer(), you can run any function or callable at all in a separate task. You can escape this serious limitation of deferred and all other replacement libraries, and pick up a few more nice features as a bonus.
Use the python package for this library. You can find the package online here.
Change to your Python App Engine project’s root folder and do the following:
pip install appenginetaskutils --target lib
Or add it to your requirements.txt. You’ll also need to set up vendoring, see app engine vendoring instructions here...
Emlyn O'Regan is a Co-Founder and CTO of xapiapps, and the author of "The Infinite Machine"