skip to navigation
skip to content

gaedeferred 0.2

A deferred library on taskqueue for Google Appengine

Downloads ↓

Latest Version: 0.2.1

What's this

gaedeferred is a module to make deferred chain on Google Appengine. By lack of taskqueue API and ext.deferred design, there is no support for error case handling as errback.

This module is inspired by Twisted.

How to

Follow steps.:

>>> from google.appengine.ext import deferred
>>> from gaedeferred import Deferred

>>> from tests.test_deferred import increase, must_be

>>> d = Deferred()

You can regist a callback.
>>> d.addCallback(increase, 10)

There is alias.
>>> d.next(must_be, 15)

The deferred chain is to be executed in an asynchronous task.
So the function increase will be called with params 5 and 10 later.
>>> deferred.defer(d.callback, 5) # doctest: +ELLIPSIS
<google.appengine.api.taskqueue.taskqueue.Task object at ...>

More details, see tests. Also the tests has how to use DeferredList.

How to test

Use nose with NoseGAE.:

$ nosetests

Or:

$ python setup.py test

To test, this module requires nose and some modules.

Note, they will be installed automatically when you run "python setup.py test".

To do

  • Consider transaction control of DeferredList doing.

Questions and Bug Reports

Changes

0.2

  • Added DeferredList.
  • Made tests robust by changing test runner to nose with NoseGAE and gaetestbed.
  • Some bugs fixed.
  • Moved developping repository to github.

0.1

  • Incompatible API change between 0.1dev to 0.1. It was my misunderstanding of Twisted deferred.
 
File Type Py Version Uploaded on Size # downloads
gaedeferred-0.2-py2.5.egg (md5) Python Egg 2.5 2011-01-06 14KB 322
gaedeferred-0.2.tar.gz (md5) Source 2011-01-06 5KB 271