App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | List of all members
google.appengine.ext.ndb.tasklets.SerialQueueFuture Class Reference
Inheritance diagram for google.appengine.ext.ndb.tasklets.SerialQueueFuture:
google.appengine.ext.ndb.tasklets.Future

Public Member Functions

def __init__
 
def complete
 
def set_exception
 
def putq
 
def add_dependent
 
def getq
 
- Public Member Functions inherited from google.appengine.ext.ndb.tasklets.Future
def __init__
 
def __repr__
 
def dump
 
def dump_stack
 
def add_callback
 
def add_immediate_callback
 
def set_result
 
def set_exception
 
def done
 
def state
 
def wait
 
def get_exception
 
def get_traceback
 
def check_success
 
def get_result
 
def wait_any
 
def wait_all
 

Additional Inherited Members

- Static Public Attributes inherited from google.appengine.ext.ndb.tasklets.Future
 IDLE = apiproxy_rpc.RPC.IDLE
 
 RUNNING = apiproxy_rpc.RPC.RUNNING
 
 FINISHING = apiproxy_rpc.RPC.FINISHING
 

Detailed Description

Like QueueFuture but maintains the order of insertion.

This class is used by Query operations.

Invariants:

- At least one of _queue and _waiting is empty.
- The Futures in _waiting are always pending.

(The Futures in _queue may be pending or completed.)

In the discussion below, add_dependent() is treated the same way as
putq().

If putq() is ahead of getq(), the situation is like this:

                       putq()
                       v
  _queue: [f1, f2, ...]; _waiting: []
  ^
  getq()

Here, putq() appends a Future to the right of _queue, and getq()
removes one from the left.

If getq() is ahead of putq(), it's like this:

            putq()
            v
  _queue: []; _waiting: [f1, f2, ...]
                                     ^
                                     getq()

Here, putq() removes a Future from the left of _waiting, and getq()
appends one to the right.

When both are empty, putq() appends a Future to the right of _queue,
while getq() appends one to the right of _waiting.

The _full flag means that no more calls to putq() will be made; it
is set by calling either complete() or set_exception().

Calling complete() signals that no more putq() calls will be made.
If getq() is behind, subsequent getq() calls will eat up _queue
until it is empty, and after that will return a Future that passes
EOFError (note that getq() itself never raises EOFError).  If getq()
is ahead when complete() is called, the Futures in _waiting are all
passed an EOFError exception (thereby eating up _waiting).

If, instead of complete(), set_exception() is called, the exception
and traceback set there will be used instead of EOFError.

The documentation for this class was generated from the following file: