Class Future (0.44.0)
Stay organized with collections
Save and categorize content based on your preferences.
This future object is returned from asychronous Pub/Sub publishing
calls.
Calling result
will resolve the future by returning the message
ID, unless an error occurs.
Methods
add_done_callback
add_done_callback(callback)
Attach the provided callable to the future.
The provided function is called, with this future as its only argument,
when the future finishes running.
Parameter |
---|
Name | Description |
callback |
Callable
The function to call.
|
cancel
Actions in Pub/Sub generally may not be canceled.
This method always returns False.
cancelled
Actions in Pub/Sub generally may not be canceled.
This method always returns False.
done
Return True the future is done, False otherwise.
This still returns True in failure cases; checking result
or
exception
is the canonical way to assess success or failure.
exception
Return the exception raised by the call, if any.
Parameter |
---|
Name | Description |
timeout |
Union[int, float]
The number of seconds before this call times out and raises TimeoutError.
|
Exceptions |
---|
Type | Description |
TimeoutError | If the request times out. |
Returns |
---|
Type | Description |
Exception | The exception raised by the call, if any. |
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 2024-09-19 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-09-19 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 2024-09-19 UTC."]]