(Object, timeout_value) — the reason, or timeout_value on timeout, or nil on fulfillment.
#rejected?
defrejected?()->Boolean
Is it in rejected state?
Returns
(Boolean)
#rescue
defrescue(*args,&task)->Future
Chains the task to be executed synchronously on executor after it rejects. Does
not run the task if it fulfills. It will resolve though, triggering any
dependent futures.
Chains the task to be executed synchronously after it fulfills. Does not run
the task if it rejects. It will resolve though, triggering any dependent futures.
[[["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-09-09 UTC."],[],[],null,["# Cloud Firestore API - Class Google::Cloud::Firestore::Promise::Future (v3.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.1.0 (latest)](/ruby/docs/reference/google-cloud-firestore/latest/Google-Cloud-Firestore-Promise-Future)\n- [3.0.0](/ruby/docs/reference/google-cloud-firestore/3.0.0/Google-Cloud-Firestore-Promise-Future)\n- [2.16.1](/ruby/docs/reference/google-cloud-firestore/2.16.1/Google-Cloud-Firestore-Promise-Future)\n- [2.15.1](/ruby/docs/reference/google-cloud-firestore/2.15.1/Google-Cloud-Firestore-Promise-Future)\n- [2.14.0](/ruby/docs/reference/google-cloud-firestore/2.14.0/Google-Cloud-Firestore-Promise-Future)\n- [2.13.1](/ruby/docs/reference/google-cloud-firestore/2.13.1/Google-Cloud-Firestore-Promise-Future)\n- [2.12.0](/ruby/docs/reference/google-cloud-firestore/2.12.0/Google-Cloud-Firestore-Promise-Future)\n- [2.11.0](/ruby/docs/reference/google-cloud-firestore/2.11.0/Google-Cloud-Firestore-Promise-Future)\n- [2.10.1](/ruby/docs/reference/google-cloud-firestore/2.10.1/Google-Cloud-Firestore-Promise-Future)\n- [2.9.1](/ruby/docs/reference/google-cloud-firestore/2.9.1/Google-Cloud-Firestore-Promise-Future)\n- [2.8.0](/ruby/docs/reference/google-cloud-firestore/2.8.0/Google-Cloud-Firestore-Promise-Future)\n- [2.7.2](/ruby/docs/reference/google-cloud-firestore/2.7.2/Google-Cloud-Firestore-Promise-Future)\n- [2.6.6](/ruby/docs/reference/google-cloud-firestore/2.6.6/Google-Cloud-Firestore-Promise-Future) \nReference documentation and code samples for the Cloud Firestore API class Google::Cloud::Firestore::Promise::Future.\n\nFuture\n------\n\nA Future object represents a value which will become available in future.\nMay reject with a reason instead, e.g. when the tasks raises an exception. \n\nInherits\n--------\n\n- Object\n\nMethods\n-------\n\n### #fulfilled?\n\n def fulfilled?() -\u003e Boolean\n\nIs it in fulfilled state? \n**Returns**\n\n- (Boolean)\n\n### #initialize\n\n def initialize(future) -\u003e Future\n\nInitialize the future object \n**Returns**\n\n- ([Future](./Google-Cloud-Firestore-Promise-Future)) --- a new instance of Future\n\n### #reason\n\n def reason(timeout = nil, timeout_value = nil) -\u003e Object, timeout_value\n\nReturns reason of future's rejection. \n**Returns**\n\n- (Object, timeout_value) --- the reason, or timeout_value on timeout, or nil on fulfillment.\n\n### #rejected?\n\n def rejected?() -\u003e Boolean\n\nIs it in rejected state? \n**Returns**\n\n- (Boolean)\n\n### #rescue\n\n def rescue(*args, &task) -\u003e Future\n\nChains the task to be executed synchronously on executor after it rejects. Does\nnot run the task if it fulfills. It will resolve though, triggering any\ndependent futures. \n**Yields**\n\n- (reason, \\*args) --- to the task. \n**Returns**\n\n- ([Future](./Google-Cloud-Firestore-Promise-Future))\n\n### #then\n\n def then(*args, &task) -\u003e Future\n\nChains the task to be executed synchronously after it fulfills. Does not run\nthe task if it rejects. It will resolve though, triggering any dependent futures. \n**Yields**\n\n- (reason, \\*args) --- to the task. \n**Returns**\n\n- ([Future](./Google-Cloud-Firestore-Promise-Future))\n\n### #value\n\n def value(timeout = nil, timeout_value = nil) -\u003e Object, nil, timeout_value\n\nMethod waits for the timeout duration and return the value of the future if\nfulfilled, timeout value in case of timeout and nil in case of rejection. \n**Parameters**\n\n- **timeout** (Integer) --- the maximum time in seconds to wait\n- **timeout_value** (Object) --- a value returned by the method when it times out \n**Returns**\n\n- (Object, nil, timeout_value) --- the value of the Future when fulfilled, timeout_value on timeout, nil on rejection.\n\n### #wait!\n\n def wait!(timeout = nil)\n\nMethod waits for the timeout duration and raise exception on rejection \n**Parameter**\n\n- **timeout** (Integer) --- the maximum time in seconds to wait"]]