[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eThis page outlines how to utilize legacy bundled services and APIs, which are exclusive to first-generation runtimes within the App Engine standard environment.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eFuture\u003c/code\u003e object represents the outcome of an asynchronous operation and stores the result once the operation is complete.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eFuture\u003c/code\u003e object includes methods like \u003ccode\u003eget_result()\u003c/code\u003e to retrieve the result, \u003ccode\u003echeck_success()\u003c/code\u003e to confirm the operation's success, and \u003ccode\u003edone()\u003c/code\u003e to check if the operation has finished.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ewait_all\u003c/code\u003e and \u003ccode\u003ewait_any\u003c/code\u003e are class methods that allow you to wait for multiple \u003ccode\u003eFutures\u003c/code\u003e to complete, either waiting for all to finish or waiting until at least one is done.\u003c/p\u003e\n"]]],[],null,["# NDB Future Class\n\n| 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](/appengine/migration-center/standard/migrate-to-second-gen/python-differences) to learn about your migration options for legacy bundled services.\n\nA `Future` represents the result of an\n[asynchronous operation](/appengine/docs/legacy/standard/python/ndb/async).\nWhen created, it probably doesn't have any result data.\nWhen the operation finishes, the `Future` gets the result.\nAn application can call a `Future` object's\n`get_result()` method; if the result has arrived, the\nmethod returns it; otherwise, it waits for the result to arrive and\n*then* returns it.\n\n**Note:** There is no 1:1 mapping between RPCs and Futures. Multiple futures might be tied to a result from a single RPC.\n\nInstance Methods\n----------------\n\ncheck_success()\n: Check to see if the operation succeeded. Waits if necessary.\n Raises an exception if there was a problem; returns `None`\n if there was no problem.\n\ndone()\n: Returns `True` if the result (or exception) has arrived;\n otherwise, returns `False`. This function does not wait.\n\nget_exception()\n: Waits if necessary; then returns the exception (or `None` if\n there was no exception). *Returns* the exception, doesn't raise it.\n\nget_result()\n: Waits if necessary; then returns the result or raises the exception.\n\nget_traceback()\n: Waits if necessary; then returns the exception's traceback\n object (or `None` if there was no traceback object).\n Python's\n [traceback](http://docs.python.org/library/traceback.html) module has functions to print and work with\n traceback objects.\n\nwait()\n: Waits until a result or exception arrives.\n Always returns `None`.\n\nClass Methods\n-------------\n\nwait_all(futures)\n: Wait until all `Futures` in the passed iterable are done.\n\n **Arguments**\n\n futures\n : Iterable of `Future` objects.\n\n\n Returns `None`.\n\nwait_any(futures)\n: Wait until at least one of a iterable of `Futures` is done.\n\n **Arguments**\n\n futures\n : Iterable of `Future` objects.\n\n\n Returns one `Future` that is done.\n (Returns `None` if the `futures` iterable is empty.)"]]