Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



NDB Future Class

A Future represents the result of an asynchronous operation . When created, it probably doesn't have any result data. When the operation finishes, the Future gets the result. An application can call a Future object's get_result() method; if the result has arrived, the method returns it; otherwise, it waits for the result to arrive and then returns it.

  1. Instance Methods

  • done()
  • get_exception()
  • get_result()
  • get_traceback()
  • wait()
  • Class Methods
  • ()
  • wait_any
  • ()

    Instance Methods

    check_success ()
    Check to see if the operation succeeded. Waits if necessary. Raises an exception if there was a problem; returns None if there was no problem.
    done ()
    Returns True if the result (or exception) has arrived; otherwise, returns False . This function does not wait.
    get_exception ()
    Waits if necessary; then returns the exception (or None if there was no exception). Returns the exception, doesn't raise it.
    get_result ()
    Waits if necessary; then returns the result or raises the exception.
    get_traceback ()
    Waits if necessary; then returns the exception's traceback object (or None if there was no traceback object). Python's traceback module has functions to print and work with traceback objects.
    wait ()
    Waits until a result or exception arrives. Always returns None .

    Class Methods

    wait_all ( futures )
    Wait until all Futures in the passed list are done.

    Arguments

    futures
    List of Future objects.

    Returns None .

    wait_any ( futures )
    Wait until at least one of a list of Futures is done.

    Arguments

    futures
    List of Future objects.

    Returns one Future that is done. (Returns None if the futures list is empty.)

    Authentication required

    You need to be signed in with Google+ to do that.

    Signing you in...

    Google Developers needs your permission to do that.