NativeFuture

A NativeFuture returns an instance of platform specific Future wrapped in a common API. Calling NativeFuture.await will wait until the result is available.

The platform specific implementations have their own constructors which wrap the native Future API.

class NativeFuture<T> : Future<T>
class NativeFuture<T>(future: <ERROR CLASS><T>) : Future<T>

Functions

await
Link copied to clipboard

Consume the future value in code as input. This method may or may not block the calling thread depending upon the implementation.

Examples

val future: Future<T> = // some api which returns a Future<T>
val value: R = future.await() // blocks until future completes

override fun await(): T
open override fun await(): T
equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
toString
Link copied to clipboard
common
open override fun toString(): String

Properties

isCompleted
Link copied to clipboard
common

Returns true if the future has completed and is ready to await.

override var isCompleted: Boolean
isCompleted
Link copied to clipboard
ios

Returns true if the future has completed and is ready to await.

open override var isCompleted: Boolean