Stay organized with collections Save and categorize content based on your preferences.
Known Indirect SubclassesHostCloudAnchorFuture
Handle to an async operation launched by Session.hostCloudAnchorAsync(Anchor, int, BiConsumer)
. ResolveAnchorOnRooftopFuture
Handle to an async operation launched by Earth.resolveAnchorOnRooftopAsync(double, double, double, float, float, float, float, BiConsumer)
. ResolveAnchorOnTerrainFuture
Handle to an async operation launched by Earth.resolveAnchorOnTerrainAsync(double, double, double, float, float, float, float, BiConsumer)
. ResolveCloudAnchorFuture
Handle to an async operation launched by Session.resolveCloudAnchorAsync(String, BiConsumer)
. VpsAvailabilityFuture
Handle to an async operation launched by Session.checkVpsAvailabilityAsync(double, double, Consumer)
.
Futures represent the eventual completion of an asynchronous operation. A future has one of three FutureState
s, which can be obtained with getState()
:
FutureState.PENDING
- The operation is still pending. The result of the operation isn't available yet and any associated callback hasn't yet been invoked.FutureState.DONE
- The operation is complete, and a result is available.FutureState.CANCELLED
- The operation has been cancelled.A Future
starts in the FutureState.PENDING
state and transitions to FutureState.DONE
upon completion. If the future is cancelled using cancel()
, then its state may become FutureState.CANCELLED
(see cancelling a future for caveats).
There are two ways of obtaining results from a Future
:
When the Future
is created, its FutureState
is set to FutureState.PENDING
. You may poll the future using getState()
to query the state of the asynchronous operation. When its state is FutureState.DONE
, you can obtain the operation's result.
The operation's result can be reported via a callback
. When providing a callback, ARCore will invoke the given function when the operation is complete, unless the future has been cancelled using cancel()
. This callback will be invoked on the main thread.
You can try to cancel a Future
by calling cancel()
. Due to multi-threading, it is possible that the cancel operation is not successful. The return value indicates if the cancellation was successful.
If the cancellation is successful, then any associated callback will never be called.
Public Methods abstract boolean
cancel()
Tries to cancel the execution of this operation.
abstract FutureState
getState()
Get the current state of the future.
Public Methods public abstract boolean cancel () cancelpublic abstract boolean cancel()
Tries to cancel the execution of this operation. If the operation was cancelled by this invocation, this method returns true
and the associated callback (if any) will never be invoked.
public abstract FutureState getState()
Get the current state of the future.
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-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["`Future` in ARCore represents the eventual result of an asynchronous operation, such as resolving a cloud anchor or checking VPS availability."],["You can obtain the result of a `Future` either by polling its state using `getState()` or by providing a callback function that will be invoked upon completion."],["A `Future` can be cancelled using `cancel()`, preventing the associated callback from being invoked, but cancellation is not always guaranteed due to multi-threading."],["`Future` has three states: `PENDING`, `DONE`, and `CANCELLED`, reflecting the status of the asynchronous operation."],["Several ARCore operations, including hosting and resolving cloud anchors, resolving anchors on terrain or rooftops, and checking VPS availability, utilize `Future` objects to handle their asynchronous nature."]]],[]]
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