A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/appengine/docs/legacy/standard/python/ndb/futureclass below:

NDB Future Class | App Engine standard environment for Python 2

NDB Future Class

Stay organized with collections Save and categorize content based on your preferences.

This page describes how to use the legacy bundled services and APIs. This API can only run in first-generation runtimes in the App Engine standard environment. If you are updating to the App Engine Python 3 runtime, refer to the migration guide to learn about your migration options for legacy bundled services.

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.

Note: There is no 1:1 mapping between RPCs and Futures. Multiple futures might be tied to a result from a single RPC.

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 iterable are done.

Arguments

futures
Iterable of Future objects.

Returns None.

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

Arguments

futures
Iterable of Future objects.

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

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["This page outlines how to utilize legacy bundled services and APIs, which are exclusive to first-generation runtimes within the App Engine standard environment."],["A `Future` object represents the outcome of an asynchronous operation and stores the result once the operation is complete."],["The `Future` object includes methods like `get_result()` to retrieve the result, `check_success()` to confirm the operation's success, and `done()` to check if the operation has finished."],["`wait_all` and `wait_any` are class methods that allow you to wait for multiple `Futures` to complete, either waiting for all to finish or waiting until at least one is done."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4