TreeFuture

abstract class TreeFuture<T : PotentiallyPartialResult>(treeId: Int, isInterruptionEnabled: Boolean)

Base class that wraps a FutureTask to allow calculating the same result across threads.

Inheritors

Constructors

Link copied to clipboard
constructor(treeId: Int, isInterruptionEnabled: Boolean)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Holder class for tree-future results. When the contained result is null, the string message will be populated with the result for it being null.

Properties

Link copied to clipboard

true if this future is interruptible.

Link copied to clipboard

true if an interrupt has been requested on this future, indicating the calculation must be resumed on the main-thread.

Link copied to clipboard

Returns true if this future has been released.

Link copied to clipboard

Functions

Link copied to clipboard
abstract fun getDescription(): String

Returns a String that gives a textual representation of the type of future it is.

Link copied to clipboard
abstract fun getVersion(): Int

Returns an integer that identifies uniquely the version of this TreeFuture.

Link copied to clipboard
abstract fun isEquivalentTo(that: TreeFuture<*>?): Boolean

Returns true if the provided TreeFuture is equivalent to this one.

Link copied to clipboard

Releases this TreeFuture

Link copied to clipboard

Synchronously executes the future task, ensuring the result is calculated, and resumed on the main thread if it is interrupted while running on a background thread.

Link copied to clipboard
fun tryRegisterForResponse(waitingFromSyncLayout: Boolean): Boolean

We want to prevent a sync layout in the background from waiting on an interrupted layout (which will return a null result). To handle this, we make sure that a sync bg layout can only wait on a NON_INTERRUPTIBLE future, and that a NON_INTERRUPTIBLE future can't be interrupted.

Link copied to clipboard