Chaining tasks on Google Appengine's (GAE) taskqueue.
Project description
A convenience module on top of the deferred library that comes with the Google AppEngine (GAE).
Note that you have to enable the deferred library in your app.yaml
builtins: - deferred: on
In a nutshell:
from waterf import queue, task queue.inorder( task(check_condition), queue.parallel( task(remove, id=101), task(remove, id=102), task(remove, id=103) ), task(email, to='foo@bar.com') ).run()
Should be pretty self-explanatory: it first runs the function check_condition, then it runs the function remove three times in parallel, after that it runs email.
To abort execution of a series you either raise queue.PermanentTaskFailure or as a convenience return queue.ABORT.
You use task() exactly the same as you used deferred.defer():
task(check, id=102, _countdown=20) task(email, to='foo@bar.com', _queue='mailer')
After constructing a task you either run() or enqueue() it; whereby:
task(foo, 'bar').enqueue() <==> deferred.defer(foo, 'bar') task(foo, 'bar').run() <==> foo('bar')
Read the tests. Thank you.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file waterf-2.zip
.
File metadata
- Download URL: waterf-2.zip
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63f08bd2a47babac2630498d7552677c26bd289249f066358a599de2c0662157 |
|
MD5 | 671d0d1c7bebf53e17222d47d0e118f6 |
|
BLAKE2b-256 | 9db29325be18e74be04d12e2e1d7f966da7a2c3b7990453faad0dae52150169b |